summaryrefslogtreecommitdiffstats
path: root/tests/lsp_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lsp_tests')
-rw-r--r--tests/lsp_tests/conftest.py19
-rw-r--r--tests/lsp_tests/lsp_tutil.py15
-rw-r--r--tests/lsp_tests/test_lsp_dctrl.py15
-rw-r--r--tests/lsp_tests/test_lsp_debputy_manifest_completer.py17
-rw-r--r--tests/lsp_tests/test_lsp_debputy_manifest_hover.py18
-rw-r--r--tests/lsp_tests/test_lsp_dpatches_series.py12
6 files changed, 37 insertions, 59 deletions
diff --git a/tests/lsp_tests/conftest.py b/tests/lsp_tests/conftest.py
index e995d88..c3c286e 100644
--- a/tests/lsp_tests/conftest.py
+++ b/tests/lsp_tests/conftest.py
@@ -7,20 +7,15 @@ from debputy.packages import DctrlParser
from debputy.plugin.api.feature_set import PluginProvidedFeatureSet
from debputy.util import setup_logging
+from debputy.lsprotocol.types import (
+ InitializeParams,
+ ClientCapabilities,
+ GeneralClientCapabilities,
+ PositionEncodingKind,
+)
+
try:
from pygls.server import LanguageServer
- from lsprotocol.types import (
- InitializeParams,
- ClientCapabilities,
- GeneralClientCapabilities,
- PositionEncodingKind,
- TextDocumentItem,
- Position,
- CompletionParams,
- TextDocumentIdentifier,
- HoverParams,
- MarkupContent,
- )
from debputy.lsp.debputy_ls import DebputyLanguageServer
HAS_PYGLS = True
diff --git a/tests/lsp_tests/lsp_tutil.py b/tests/lsp_tests/lsp_tutil.py
index bc0fa91..8c0827e 100644
--- a/tests/lsp_tests/lsp_tutil.py
+++ b/tests/lsp_tests/lsp_tutil.py
@@ -1,16 +1,17 @@
import dataclasses
-from typing import Tuple, Union, FrozenSet, Optional, List
+from typing import Tuple, FrozenSet, Optional, List
from debputy.lsp.lsp_features import SEMANTIC_TOKENS_LEGEND
from debputy.util import grouper
+from debputy.lsprotocol.types import (
+ TextDocumentItem,
+ Position,
+ Range,
+ SemanticTokens,
+)
+
try:
- from lsprotocol.types import (
- TextDocumentItem,
- Position,
- Range,
- SemanticTokens,
- )
from debputy.lsp.debputy_ls import DebputyLanguageServer
except ImportError:
pass
diff --git a/tests/lsp_tests/test_lsp_dctrl.py b/tests/lsp_tests/test_lsp_dctrl.py
index e93ba17..ab55bb8 100644
--- a/tests/lsp_tests/test_lsp_dctrl.py
+++ b/tests/lsp_tests/test_lsp_dctrl.py
@@ -4,16 +4,15 @@ from typing import Optional
import pytest
from debputy.lsp.debputy_ls import DebputyLanguageServer
+from debputy.lsprotocol.types import (
+ CompletionParams,
+ TextDocumentIdentifier,
+ HoverParams,
+ MarkupContent,
+ SemanticTokensParams,
+)
try:
- from lsprotocol.types import (
- CompletionParams,
- TextDocumentIdentifier,
- HoverParams,
- MarkupContent,
- SemanticTokensParams,
- )
-
from debputy.lsp.lsp_debian_control import (
_debian_control_completions,
_debian_control_hover,
diff --git a/tests/lsp_tests/test_lsp_debputy_manifest_completer.py b/tests/lsp_tests/test_lsp_debputy_manifest_completer.py
index dab26d3..f052164 100644
--- a/tests/lsp_tests/test_lsp_debputy_manifest_completer.py
+++ b/tests/lsp_tests/test_lsp_debputy_manifest_completer.py
@@ -1,21 +1,14 @@
import textwrap
+from debputy.lsprotocol.types import (
+ CompletionParams,
+ TextDocumentIdentifier,
+)
from lsp_tests.lsp_tutil import put_doc_with_cursor
try:
from pygls.server import LanguageServer
- from lsprotocol.types import (
- InitializeParams,
- ClientCapabilities,
- GeneralClientCapabilities,
- PositionEncodingKind,
- TextDocumentItem,
- Position,
- CompletionParams,
- TextDocumentIdentifier,
- HoverParams,
- MarkupContent,
- )
+
from debputy.lsp.lsp_debian_debputy_manifest import debputy_manifest_completer
from debputy.lsp.debputy_ls import DebputyLanguageServer
diff --git a/tests/lsp_tests/test_lsp_debputy_manifest_hover.py b/tests/lsp_tests/test_lsp_debputy_manifest_hover.py
index 54c6b6a..06422ca 100644
--- a/tests/lsp_tests/test_lsp_debputy_manifest_hover.py
+++ b/tests/lsp_tests/test_lsp_debputy_manifest_hover.py
@@ -5,20 +5,14 @@ import pytest
from debputy.lsp.debputy_ls import DebputyLanguageServer
from lsp_tests.lsp_tutil import put_doc_with_cursor
+from debputy.lsprotocol.types import (
+ TextDocumentIdentifier,
+ HoverParams,
+ MarkupContent,
+)
+
try:
from pygls.server import LanguageServer
- from lsprotocol.types import (
- InitializeParams,
- ClientCapabilities,
- GeneralClientCapabilities,
- PositionEncodingKind,
- TextDocumentItem,
- Position,
- CompletionParams,
- TextDocumentIdentifier,
- HoverParams,
- MarkupContent,
- )
from debputy.lsp.lsp_debian_debputy_manifest import debputy_manifest_hover
HAS_PYGLS = True
diff --git a/tests/lsp_tests/test_lsp_dpatches_series.py b/tests/lsp_tests/test_lsp_dpatches_series.py
index e7a1275..6e0ff3f 100644
--- a/tests/lsp_tests/test_lsp_dpatches_series.py
+++ b/tests/lsp_tests/test_lsp_dpatches_series.py
@@ -1,16 +1,12 @@
import textwrap
from debputy.lsp.debputy_ls import DebputyLanguageServer
+from debputy.lsprotocol.types import (
+ TextDocumentIdentifier,
+ SemanticTokensParams,
+)
try:
- from lsprotocol.types import (
- CompletionParams,
- TextDocumentIdentifier,
- HoverParams,
- MarkupContent,
- SemanticTokensParams,
- )
-
from debputy.lsp.lsp_debian_patches_series import (
_debian_patches_semantic_tokens_full,
_debian_patches_series_completions,