mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
gir: Gracefully handle missing .gir files
They aren't required for compilation anymore, and not being able to show documentation on hover is probably not worth crashing the language server over.
This commit is contained in:
parent
06f54c8ff8
commit
c5f2e4ed4b
1 changed files with 8 additions and 3 deletions
|
@ -214,9 +214,14 @@ class GirNode:
|
||||||
if self.signature:
|
if self.signature:
|
||||||
sections.append("```\n" + self.signature + "\n```")
|
sections.append("```\n" + self.signature + "\n```")
|
||||||
|
|
||||||
el = self.xml.get_elements("doc")
|
try:
|
||||||
if len(el) == 1:
|
el = self.xml.get_elements("doc")
|
||||||
sections.append(el[0].cdata.strip())
|
if len(el) == 1:
|
||||||
|
sections.append(el[0].cdata.strip())
|
||||||
|
except:
|
||||||
|
# Not a huge deal, but if you want docs in the language server you
|
||||||
|
# should ensure .gir files are installed
|
||||||
|
pass
|
||||||
|
|
||||||
return "\n\n---\n\n".join(sections)
|
return "\n\n---\n\n".join(sections)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue