lsp: Extend completion documentation

This commit is contained in:
Sonny Piers 2024-06-16 14:18:08 +02:00 committed by Sonny Piers
parent da5b9909fc
commit a075b26769
3 changed files with 42 additions and 9 deletions

View file

@ -336,6 +336,15 @@ class GirNode:
def available_in(self) -> str:
return self.xml.get("version")
@cached_property
def detail(self) -> T.Optional[str]:
try:
el = self.xml.get_elements("doc")
if len(el) == 1:
return el[0].cdata.strip().partition("\n")[0]
except:
return None
@cached_property
def doc(self) -> T.Optional[str]:
sections = []