diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:43:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:43:21 +0000 |
commit | 0bdb089380893d6d300f9a715aab0db0a7f718ef (patch) | |
tree | 3a564777bb206365223137abb1717ab0a0e868bc /tests/lsp_tests | |
parent | Adding debian version 0.1.34. (diff) | |
download | debputy-0bdb089380893d6d300f9a715aab0db0a7f718ef.tar.xz debputy-0bdb089380893d6d300f9a715aab0db0a7f718ef.zip |
Merging upstream version 0.1.35.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/lsp_tests')
-rw-r--r-- | tests/lsp_tests/test_lsp_debputy_manifest_completer.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/lsp_tests/test_lsp_debputy_manifest_completer.py b/tests/lsp_tests/test_lsp_debputy_manifest_completer.py index 196df2e..dab26d3 100644 --- a/tests/lsp_tests/test_lsp_debputy_manifest_completer.py +++ b/tests/lsp_tests/test_lsp_debputy_manifest_completer.py @@ -597,3 +597,52 @@ def test_basic_debputy_completer_manifest_conditions( assert "not:" in keywords # str-only forms are not applicable here assert "cross-compiling" not in keywords + + +def test_basic_debputy_completer_mid_doc(ls: "DebputyLanguageServer") -> None: + debputy_manifest_uri = "file:///nowhere/debian/debputy.manifest" + cursor_pos = put_doc_with_cursor( + ls, + debputy_manifest_uri, + "debian/debputy.manifest", + textwrap.dedent( + """\ + manifest-version: 0.1 + installations: + - install-docs: + s<CURSOR> + - foo +""" + ), + ) + + completions = debputy_manifest_completer( + ls, + CompletionParams(TextDocumentIdentifier(debputy_manifest_uri), cursor_pos), + ) + assert isinstance(completions, list) + keywords = {m.label for m in completions} + assert "sources:" in keywords + + cursor_pos = put_doc_with_cursor( + ls, + debputy_manifest_uri, + "debian/debputy.manifest", + textwrap.dedent( + """\ + manifest-version: 0.1 + installations: + - install-docs: + s<CURSOR>: + - foo +""" + ), + ) + + completions = debputy_manifest_completer( + ls, + CompletionParams(TextDocumentIdentifier(debputy_manifest_uri), cursor_pos), + ) + assert isinstance(completions, list) + keywords = {m.label for m in completions} + assert "sources" in keywords |