mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Add hover docs for lookup expression props
This commit is contained in:
parent
8dfa10019b
commit
8d734f7bbd
1 changed files with 11 additions and 0 deletions
|
@ -130,6 +130,17 @@ class LookupOp(InfixExpr):
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@docs("property")
|
||||||
|
def property_docs(self):
|
||||||
|
if not (
|
||||||
|
isinstance(self.lhs.type, gir.Class)
|
||||||
|
or isinstance(self.lhs.type, gir.Interface)
|
||||||
|
):
|
||||||
|
return None
|
||||||
|
|
||||||
|
if property := self.lhs.type.properties.get(self.property_name):
|
||||||
|
return property.doc
|
||||||
|
|
||||||
@validate("property")
|
@validate("property")
|
||||||
def property_exists(self):
|
def property_exists(self):
|
||||||
if self.lhs.type is None:
|
if self.lhs.type is None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue