mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Add reference documentation on hover
For most constructs and keywords, show the relevant section of the reference documentation on hover.
This commit is contained in:
parent
b107a85947
commit
e19975e1f8
28 changed files with 326 additions and 21 deletions
|
@ -40,6 +40,10 @@ class SignalFlag(AstNode):
|
|||
f"Duplicate flag '{self.flag}'", lambda x: x.flag == self.flag
|
||||
)
|
||||
|
||||
@docs()
|
||||
def ref_docs(self):
|
||||
return get_docs_section("Syntax Signal")
|
||||
|
||||
|
||||
class Signal(AstNode):
|
||||
grammar = Statement(
|
||||
|
@ -50,7 +54,7 @@ class Signal(AstNode):
|
|||
UseIdent("detail_name").expected("a signal detail name"),
|
||||
]
|
||||
),
|
||||
"=>",
|
||||
Keyword("=>"),
|
||||
Mark("detail_start"),
|
||||
Optional(["$", UseLiteral("extern", True)]),
|
||||
UseIdent("handler").expected("the name of a function to handle the signal"),
|
||||
|
@ -184,6 +188,10 @@ class Signal(AstNode):
|
|||
if prop is not None:
|
||||
return prop.doc
|
||||
|
||||
@docs("=>")
|
||||
def ref_docs(self):
|
||||
return get_docs_section("Syntax Signal")
|
||||
|
||||
|
||||
@decompiler("signal")
|
||||
def decompile_signal(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue