summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/debputy/linting/lint_impl.py4
-rw-r--r--src/debputy/lsp/lsp_debian_changelog.py15
-rw-r--r--src/debputy/lsp/lsp_debian_control.py10
-rw-r--r--src/debputy/lsp/lsp_debian_copyright.py9
-rw-r--r--src/debputy/lsp/lsp_features.py2
-rw-r--r--src/debputy/lsp/quickfixes.py1
-rw-r--r--src/debputy/packaging/alternatives.py2
7 files changed, 5 insertions, 38 deletions
diff --git a/src/debputy/linting/lint_impl.py b/src/debputy/linting/lint_impl.py
index 7248022..5df76c4 100644
--- a/src/debputy/linting/lint_impl.py
+++ b/src/debputy/linting/lint_impl.py
@@ -139,7 +139,7 @@ def _auto_fix_run(
CodeActionContext(
[diagnostic],
),
- )
+ ),
)
auto_fixing_edits = resolve_auto_fixer(filename, actions)
@@ -285,7 +285,7 @@ def _diagnostics_run(
CodeActionContext(
[diagnostic],
),
- )
+ ),
)
auto_fixer = resolve_auto_fixer(filename, actions)
has_auto_fixer = bool(auto_fixer)
diff --git a/src/debputy/lsp/lsp_debian_changelog.py b/src/debputy/lsp/lsp_debian_changelog.py
index 77df145..f99a63b 100644
--- a/src/debputy/lsp/lsp_debian_changelog.py
+++ b/src/debputy/lsp/lsp_debian_changelog.py
@@ -13,11 +13,8 @@ from lsprotocol.types import (
Diagnostic,
DidOpenTextDocumentParams,
DidChangeTextDocumentParams,
- TEXT_DOCUMENT_DID_OPEN,
- TEXT_DOCUMENT_DID_CHANGE,
TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL,
TEXT_DOCUMENT_CODE_ACTION,
- TEXT_DOCUMENT_DID_CLOSE,
DidCloseTextDocumentParams,
Range,
Position,
@@ -26,12 +23,10 @@ from lsprotocol.types import (
from debputy.lsp.lsp_features import lsp_diagnostics, lsp_standard_handler
from debputy.lsp.quickfixes import (
- provide_standard_quickfixes_from_diagnostics,
propose_correct_text_quick_fix,
)
from debputy.lsp.spellchecking import spellcheck_line
from debputy.lsp.text_util import (
- on_save_trim_end_of_line_whitespace,
LintCapablePositionCodec,
)
@@ -68,16 +63,6 @@ _KNOWN_WEEK_DAYS = frozenset(_WEEKDAYS_BY_IDX)
DOCUMENT_VERSION_TABLE: Dict[str, int] = {}
-def register_dch_lsp(ls: "LanguageServer") -> None:
- ls.feature(TEXT_DOCUMENT_DID_OPEN)(_diagnostics_debian_changelog)
- ls.feature(TEXT_DOCUMENT_DID_CHANGE)(_diagnostics_debian_changelog)
- ls.feature(TEXT_DOCUMENT_DID_CLOSE)(_handle_close)
- ls.feature(TEXT_DOCUMENT_CODE_ACTION)(
- ls.thread()(provide_standard_quickfixes_from_diagnostics)
- )
- ls.feature(TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL)(on_save_trim_end_of_line_whitespace)
-
-
def _handle_close(
ls: "LanguageServer",
params: DidCloseTextDocumentParams,
diff --git a/src/debputy/lsp/lsp_debian_control.py b/src/debputy/lsp/lsp_debian_control.py
index f73612f..8b6238c 100644
--- a/src/debputy/lsp/lsp_debian_control.py
+++ b/src/debputy/lsp/lsp_debian_control.py
@@ -21,19 +21,13 @@ from lsprotocol.types import (
CompletionItem,
CompletionList,
CompletionParams,
- TEXT_DOCUMENT_DID_OPEN,
- TEXT_DOCUMENT_DID_CHANGE,
- TEXT_DOCUMENT_COMPLETION,
TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL,
DiagnosticRelatedInformation,
Location,
- TEXT_DOCUMENT_HOVER,
HoverParams,
Hover,
TEXT_DOCUMENT_CODE_ACTION,
DiagnosticTag,
- SemanticTokensLegend,
- TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL,
SemanticTokens,
SemanticTokensParams,
)
@@ -62,11 +56,9 @@ from debputy.lsp.quickfixes import (
propose_remove_line_quick_fix,
range_compatible_with_remove_line_fix,
propose_correct_text_quick_fix,
- provide_standard_quickfixes_from_diagnostics,
)
from debputy.lsp.spellchecking import default_spellchecker
from debputy.lsp.text_util import (
- on_save_trim_end_of_line_whitespace,
normalize_dctrl_field_name,
LintCapablePositionCodec,
detect_possible_typo,
@@ -85,7 +77,7 @@ from debputy.lsp.vendoring._deb822_repro.tokens import (
Deb822Token,
Deb822FieldNameToken,
)
-from debputy.util import _info, _error
+from debputy.util import _info
try:
from debputy.lsp.vendoring._deb822_repro.locatable import (
diff --git a/src/debputy/lsp/lsp_debian_copyright.py b/src/debputy/lsp/lsp_debian_copyright.py
index f22bd0b..995d93f 100644
--- a/src/debputy/lsp/lsp_debian_copyright.py
+++ b/src/debputy/lsp/lsp_debian_copyright.py
@@ -18,19 +18,13 @@ from lsprotocol.types import (
CompletionItem,
CompletionList,
CompletionParams,
- TEXT_DOCUMENT_DID_OPEN,
- TEXT_DOCUMENT_DID_CHANGE,
- TEXT_DOCUMENT_COMPLETION,
TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL,
DiagnosticRelatedInformation,
Location,
- TEXT_DOCUMENT_HOVER,
HoverParams,
Hover,
TEXT_DOCUMENT_CODE_ACTION,
DiagnosticTag,
- SemanticTokensLegend,
- TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL,
SemanticTokens,
SemanticTokensParams,
FoldingRangeParams,
@@ -61,11 +55,9 @@ from debputy.lsp.lsp_generic_deb822 import (
from debputy.lsp.quickfixes import (
propose_remove_line_quick_fix,
propose_correct_text_quick_fix,
- provide_standard_quickfixes_from_diagnostics,
)
from debputy.lsp.spellchecking import default_spellchecker
from debputy.lsp.text_util import (
- on_save_trim_end_of_line_whitespace,
normalize_dctrl_field_name,
LintCapablePositionCodec,
detect_possible_typo,
@@ -84,7 +76,6 @@ from debputy.lsp.vendoring._deb822_repro.tokens import (
Deb822Token,
Deb822FieldNameToken,
)
-from debputy.util import _error
try:
from debputy.lsp.vendoring._deb822_repro.locatable import (
diff --git a/src/debputy/lsp/lsp_features.py b/src/debputy/lsp/lsp_features.py
index 8260675..5b01266 100644
--- a/src/debputy/lsp/lsp_features.py
+++ b/src/debputy/lsp/lsp_features.py
@@ -42,7 +42,7 @@ _ALIAS_OF = {}
_STANDARD_HANDLERS = {
TEXT_DOCUMENT_CODE_ACTION: (
CODE_ACTION_HANDLERS,
- provide_standard_quickfixes_from_diagnostics,
+ lambda ls, params: provide_standard_quickfixes_from_diagnostics(params),
),
TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL: (
WILL_SAVE_WAIT_UNTIL_HANDLERS,
diff --git a/src/debputy/lsp/quickfixes.py b/src/debputy/lsp/quickfixes.py
index 7ae0324..d911961 100644
--- a/src/debputy/lsp/quickfixes.py
+++ b/src/debputy/lsp/quickfixes.py
@@ -172,7 +172,6 @@ def _correct_value_code_action(
def provide_standard_quickfixes_from_diagnostics(
- ls: "LanguageServer",
code_action_params: CodeActionParams,
) -> Optional[List[Union[Command, CodeAction]]]:
actions = []
diff --git a/src/debputy/packaging/alternatives.py b/src/debputy/packaging/alternatives.py
index 249fa9e..53e337d 100644
--- a/src/debputy/packaging/alternatives.py
+++ b/src/debputy/packaging/alternatives.py
@@ -113,7 +113,7 @@ def process_alternative(
escape_shell(
"update-alternatives",
"--remove",
- link_path,
+ name,
impl_path,
)
]