From d97af952107df03053391dfe42e73ed4ffa14184 Mon Sep 17 00:00:00 2001 From: Wu Zhenyu Date: Thu, 15 Feb 2024 15:28:53 +0800 Subject: [PATCH] :alien: Remove ErrorQueryFinder --- src/termux_language_server/finders.py | 28 +++------------------------ 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/src/termux_language_server/finders.py b/src/termux_language_server/finders.py index 15c5a27..523a730 100644 --- a/src/termux_language_server/finders.py +++ b/src/termux_language_server/finders.py @@ -17,7 +17,7 @@ from tree_sitter import Node, Tree from tree_sitter_lsp import UNI, Finder from tree_sitter_lsp.finders import ( - ErrorQueryFinder, + ErrorFinder, QueryFinder, SchemaFinder, UnFixedOrderFinder, @@ -28,28 +28,6 @@ from .utils import get_query, get_schema -@dataclass(init=False) -class ErrorBashFinder(ErrorQueryFinder): - r"""Errorbashfinder.""" - - def __init__( - self, - message: str = "{{uni.get_text()}}: error", - severity: DiagnosticSeverity = DiagnosticSeverity.Error, - ) -> None: - r"""Init. - - :param filetype: - :type filetype: str - :param message: - :type message: str - :param severity: - :type severity: DiagnosticSeverity - :rtype: None - """ - super().__init__("bash", message, severity) - - @dataclass(init=False) class BashFinder(SchemaFinder): r"""Bashfinder.""" @@ -326,7 +304,7 @@ def __call__(self, uni: UNI) -> bool: return self.is_csv(uni) def get_document_links( - self, uri: str, tree: Tree, template: str + self, uri: str, tree: Tree, template: str = "" ) -> list[DocumentLink]: r"""Get document links. @@ -418,7 +396,7 @@ def __init__( DIAGNOSTICS_FINDER_CLASSES = [ - ErrorBashFinder, + ErrorFinder, BashFinder, UnsortedKeywordFinder, UnsortedCSVFinder,