diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 82c7a7b..e78d390 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: args: - --msg-filename - repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: 2.7.2 + rev: 2.7.3 hooks: - id: editorconfig-checker - repo: https://github.com/jumanjihouse/pre-commit-hooks @@ -51,7 +51,7 @@ repos: hooks: - id: actionlint - repo: https://github.com/adrienverge/yamllint - rev: v1.32.0 + rev: v1.33.0 hooks: - id: yamllint - repo: https://github.com/executablebooks/mdformat @@ -74,7 +74,7 @@ repos: additional_dependencies: - markdown-it-texmath - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.11.0 hooks: - id: black - repo: https://github.com/PyCQA/isort @@ -88,7 +88,7 @@ repos: additional_dependencies: - tomli - repo: https://github.com/kumaraditya303/mirrors-pyright - rev: v1.1.329 + rev: v1.1.335 hooks: - id: pyright - repo: https://github.com/PyCQA/bandit diff --git a/requirements.txt b/requirements.txt index 495496b..915cbe7 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ #!/usr/bin/env -S pip install -r tree-sitter-languages -tree-sitter-lsp +tree-sitter-lsp >= 0.0.4 diff --git a/src/autotools_language_server/finders.py b/src/autotools_language_server/finders.py index 4bf35e3..3a63f50 100644 --- a/src/autotools_language_server/finders.py +++ b/src/autotools_language_server/finders.py @@ -145,6 +145,7 @@ def __init__(self, node: Node) -> None: parent = node.parent if parent is None: raise TypeError + self.is_define = lambda _: False if parent.type == "arguments": self.is_define = self.is_function_define # https://github.com/alemuller/tree-sitter-make/issues/8 @@ -158,8 +159,6 @@ def __init__(self, node: Node) -> None: self.is_define = self.is_variable_define elif parent.type == "prerequisites": self.is_define = self.is_target_define - else: - raise NotImplementedError def is_function_define(self, uni: UNI) -> bool: r"""Is function define. @@ -255,14 +254,13 @@ def __init__(self, node: Node) -> None: parent = node.parent if parent is None: raise TypeError + self.is_reference = lambda _: False if parent.type == "define_directive": self.is_reference = self.is_function_reference elif parent.type == "variable_assignment": self.is_reference = self.is_variable_reference elif parent.type == "prerequisites": self.is_reference = self.is_target_reference - else: - raise NotImplementedError def is_function_reference(self, uni: UNI) -> bool: r"""Is function reference.