mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-07-07 01:29:26 -04:00
lsp: Fix crash on object references
Fix a crash that occurred when you hovered over a reference to an object that has an invalid class name.
This commit is contained in:
parent
61acfbda98
commit
c75e00253b
1 changed files with 8 additions and 5 deletions
|
@ -71,12 +71,15 @@ class Object(AstNode):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def signature(self) -> str:
|
def signature(self) -> str:
|
||||||
if self.id:
|
if t := self.class_name.gir_type:
|
||||||
return f"{self.class_name.gir_type.full_name} {self.id}"
|
result = t.full_name
|
||||||
elif t := self.class_name.gir_type:
|
|
||||||
return f"{t.full_name}"
|
|
||||||
else:
|
else:
|
||||||
return f"{self.class_name.as_string}"
|
result = self.class_name.as_string
|
||||||
|
|
||||||
|
if self.id:
|
||||||
|
result += " " + self.id
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def document_symbol(self) -> T.Optional[DocumentSymbol]:
|
def document_symbol(self) -> T.Optional[DocumentSymbol]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue