mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Implement semantic tokens
This commit is contained in:
parent
7a65956195
commit
dfb09b9357
6 changed files with 65 additions and 5 deletions
|
@ -22,6 +22,7 @@ from collections import ChainMap, defaultdict
|
|||
|
||||
from . import ast
|
||||
from .errors import *
|
||||
from .lsp_utils import SemanticToken
|
||||
from .utils import lazy_prop
|
||||
from .xml_emitter import XmlEmitter
|
||||
|
||||
|
@ -112,6 +113,10 @@ class AstNode:
|
|||
|
||||
return None
|
||||
|
||||
def get_semantic_tokens(self) -> T.Iterator[SemanticToken]:
|
||||
for child in self.children:
|
||||
yield from child.get_semantic_tokens()
|
||||
|
||||
|
||||
def validate(token_name=None, end_token_name=None, skip_incomplete=False):
|
||||
""" Decorator for functions that validate an AST node. Exceptions raised
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue