add more semantic tokens
This commit is contained in:
@@ -52,7 +52,7 @@ from tclint.format import Formatter, FormatterOpts
|
||||
from tclint.violations import Violation
|
||||
|
||||
from plugins.poco_plugin import commands
|
||||
from tools import checks
|
||||
from tools import checks, parser
|
||||
from tools.semantic_tokens import _Highlighter, TOKEN_TYPES, TokenModifier
|
||||
from tools.completion_items import _Completion
|
||||
|
||||
@@ -62,7 +62,7 @@ DIAGNOSTIC_SOURCE = "nx-post-support"
|
||||
class TclLanguageServer(server.LanguageServer):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.parser = Parser()
|
||||
self.parser = parser.CustomParser() # Parser()
|
||||
for command in commands:
|
||||
self.parser._commands.update(command)
|
||||
self.diagnostics = {}
|
||||
@@ -201,6 +201,8 @@ def did_open(params: lsp.DidOpenTextDocumentParams) -> None:
|
||||
def did_save(params: lsp.DidSaveTextDocumentParams) -> None:
|
||||
"""LSP handler for textDocument/didSave request."""
|
||||
document = LSP_SERVER.workspace.get_text_document(params.text_document.uri)
|
||||
tree = LSP_SERVER.parser.parse(document.source)
|
||||
log_to_output(tree.pretty(2))
|
||||
|
||||
|
||||
@LSP_SERVER.feature(lsp.TEXT_DOCUMENT_DID_CLOSE)
|
||||
|
||||
Reference in New Issue
Block a user