mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Add more "go to reference" implementations
This commit is contained in:
parent
94b532bc35
commit
f6d05be10b
3 changed files with 27 additions and 0 deletions
|
@ -39,6 +39,12 @@ class Widget(AstNode):
|
|||
self.group.tokens["name"].range,
|
||||
)
|
||||
|
||||
def get_reference(self, _idx: int) -> T.Optional[LocationLink]:
|
||||
if obj := self.context[ScopeCtx].objects.get(self.name):
|
||||
return LocationLink(self.range, obj.range, obj.ranges["id"])
|
||||
else:
|
||||
return None
|
||||
|
||||
@validate("name")
|
||||
def obj_widget(self):
|
||||
object = self.context[ScopeCtx].objects.get(self.tokens["name"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue