|
11 | 11 | from pygls.workspace import TextDocument |
12 | 12 |
|
13 | 13 | from tclint.cli import tclint, utils |
| 14 | +from tclint.commands.plugins import PluginManager |
14 | 15 | from tclint.config import DEFAULT_CONFIGS, Config, ConfigError, load_config_at |
15 | 16 | from tclint.format import Formatter, FormatterOpts |
16 | 17 | from tclint.lexer import TclSyntaxError |
|
26 | 27 | _DEFAULT_CONFIG = Config() |
27 | 28 |
|
28 | 29 |
|
29 | | -def lint(source, config, path): |
| 30 | +def lint(source, config, plugin_manager, path): |
30 | 31 | diagnostics = [] |
31 | 32 |
|
32 | 33 | try: |
33 | | - violations = tclint.lint(source, config, path) |
| 34 | + violations = tclint.lint(source, config, plugin_manager, path) |
34 | 35 | except TclSyntaxError as e: |
35 | 36 | return [ |
36 | 37 | lsp.Diagnostic( |
@@ -99,6 +100,8 @@ def __init__(self, *args, **kwargs): |
99 | 100 | self.global_settings = ExtensionSettings() |
100 | 101 | self.workspace_settings: dict[Path, ExtensionSettings] = {} |
101 | 102 |
|
| 103 | + self.plugin_manager = PluginManager() |
| 104 | + |
102 | 105 | def get_roots(self) -> list[Path]: |
103 | 106 | """Returns root folders currently open in the workspace.""" |
104 | 107 | roots = [] |
@@ -221,7 +224,7 @@ def _compute_diagnostics(self, document: TextDocument) -> list[lsp.Diagnostic]: |
221 | 224 | if is_excluded(path): |
222 | 225 | return [] |
223 | 226 |
|
224 | | - return lint(document.source, config, path) |
| 227 | + return lint(document.source, config, self.plugin_manager, path) |
225 | 228 |
|
226 | 229 | def compute_diagnostics(self, document: TextDocument): |
227 | 230 | # `None` sentinel ensures that `diagnostics` gets updated if the URI is not |
|
0 commit comments