Skip to content

Add name location to classes and modules #487

@vinistock

Description

@vinistock

There's one thing missing from class and module indexing to match the LSP: their name location (as opposed to the entire definition's location).

This is necessary because of the way the LSP spec works in this case (example taken from our own code):

class Entry
  class Method < Entry # go to def here
  end
end

Because the parent class Entry constant reference is fully inside the class Entry's location, the editor fires a find references request instead of a go to definition one. This is incorrect since Entry is a reference.

The spec's way of fixing this is allowing servers to return both a name and selection locations, which is what we need to start indexing. The name location is simply the location of the module/class constant_path.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions