lsp: Show better info on IdentLiteral hover

Instead of showing the documentation for the expected type, show the
signature of the referenced object.
This commit is contained in:
James Westman 2023-07-06 21:21:24 -05:00
parent 9ff76b65cc
commit cb1eb9ba44
5 changed files with 41 additions and 6 deletions

View file

@ -9,6 +9,14 @@ from .types import TypeName
class ExtListItemFactory(AstNode):
grammar = [UseExact("id", "template"), Optional(TypeName), ObjectContent]
@property
def id(self) -> str:
return "template"
@property
def signature(self) -> str:
return f"template {self.gir_class.full_name}"
@property
def type_name(self) -> T.Optional[TypeName]:
if len(self.children[TypeName]) == 1: