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
|
@ -179,14 +179,16 @@ class AstNode:
|
|||
token = self.group.tokens.get(attr.token_name)
|
||||
if token and token.start <= idx < token.end:
|
||||
return getattr(self, name)
|
||||
else:
|
||||
return getattr(self, name)
|
||||
|
||||
for child in self.children:
|
||||
if idx in child.range:
|
||||
if docs := child.get_docs(idx):
|
||||
return docs
|
||||
|
||||
for name, attr in self._attrs_by_type(Docs):
|
||||
if not attr.token_name:
|
||||
return getattr(self, name)
|
||||
|
||||
return None
|
||||
|
||||
def get_semantic_tokens(self) -> T.Iterator[SemanticToken]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue