modify linter / checks

This commit is contained in:
Christoph Brandau
2025-07-28 22:15:19 +02:00
parent 4d79f268b8
commit 9a56aca6ef
8 changed files with 59 additions and 486 deletions
+7 -13
View File
@@ -54,17 +54,18 @@ from tools.semantic_tokens import (
collect_semantic_tokens,
encode_tokens,
)
from nx_plugins.poco_plugin import commands
from tools import poco_check
from plugins.poco_plugin import commands
from tools import checks
DIAGNOSTIC_SOURCE = "tclint"
DIAGNOSTIC_SOURCE = "nx-post-support"
class TclLanguageServer(server.LanguageServer):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.parser = Parser()
self.parser._commands.update(commands)
for command in commands:
self.parser._commands.update(command)
self.diagnostics = {}
def format(
@@ -98,19 +99,12 @@ class TclLanguageServer(server.LanguageServer):
document: TextDocument,
) -> List[Violation]:
violations = []
self.parser.violations = []
tree = self.parser.parse(document.source)
violations += self.parser.violations
# if debug > 0:
# print(tree.pretty(positions=(debug > 1)))
for checker in poco_check.get_checkers():
for checker in checks.get_checkers():
violations += checker.check(document.source, tree)
# v = CommentVisitor()
# ignore_lines = v.run(tree, path)
# violations = filter_violations(violations, config.ignore, ignore_lines)
return violations
def lint(self, document: TextDocument):