summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
authorJoão Costa <jdpc557@gmail.com>2022-04-01 13:41:05 +0100
committerGitHub <noreply@github.com>2022-04-01 12:41:05 +0000
commitbc406a846ea6873152cfb2d6ba50456f03d7cbb4 (patch)
tree9efa7b8aeefa50e7790cb7c7a46a80056cc96a7a /test/completion
parent0f55d371e92160812ff0a57b5f48f2010a420f0c (diff)
downloadale-bc406a846ea6873152cfb2d6ba50456f03d7cbb4.zip
Set default value for insertTextFormat (#4124)
Co-authored-by: w0rp <devw0rp@gmail.com>
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/test_lsp_completion_parsing.vader32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/completion/test_lsp_completion_parsing.vader b/test/completion/test_lsp_completion_parsing.vader
index a334d945..7fe22e0c 100644
--- a/test/completion/test_lsp_completion_parsing.vader
+++ b/test/completion/test_lsp_completion_parsing.vader
@@ -528,6 +528,38 @@ Execute(Should handle completion messages with textEdit objects):
\ },
\ })
+Execute(Should handle completion messages with textEdit objects and no insertTextFormat key):
+ let g:ale_completion_autoimport = 0
+
+ AssertEqual
+ \ [
+ \ {'word': 'next_callback', 'dup': 0, 'menu': 'PlayTimeCallback', 'info': '', 'kind': 'v', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ ],
+ \ ale#completion#ParseLSPCompletions({
+ \ 'id': 226,
+ \ 'jsonrpc': '2.0',
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'detail': 'PlayTimeCallback',
+ \ 'filterText': 'next_callback',
+ \ 'insertText': 'ignoreme',
+ \ 'kind': 6,
+ \ 'label': ' next_callback',
+ \ 'sortText': '3ee19999next_callback',
+ \ 'textEdit': {
+ \ 'newText': 'next_callback',
+ \ 'range': {
+ \ 'end': {'character': 13, 'line': 12},
+ \ 'start': {'character': 4, 'line': 12},
+ \ },
+ \ },
+ \ },
+ \ ],
+ \ },
+ \ })
+
Execute(Should handle completion messages with the deprecated insertText attribute):
let g:ale_completion_autoimport = 0