diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-06-13 18:30:01 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-06-13 18:30:01 +0800 |
commit | 4081b303684b95ec27fd833a1cd10978d4ad5e10 (patch) | |
tree | bd286d27d262934d662926247e885b56b72bd489 /test/completion | |
parent | cda4ec3f67a93a907752cc98572f0dac9c5dd83e (diff) | |
download | lua-language-server-4081b303684b95ec27fd833a1cd10978d4ad5e10.zip |
more smart completion for `continue`
fix #2042
Diffstat (limited to 'test/completion')
-rw-r--r-- | test/completion/common.lua | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua index 8d23822a..8d53b89a 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -4114,3 +4114,73 @@ f({ kind = define.CompletionItemKind.Text, }, } + +TEST [[ +while true do + continue<??> +end +]] +{ + { + label = 'continue', + kind = define.CompletionItemKind.Keyword, + }, + { + label = 'goto continue ..', + kind = define.CompletionItemKind.Snippet, + additionalTextEdits = { + { + start = 10004, + finish = 10004, + newText = 'goto ', + }, + { + start = 20000, + finish = 20000, + newText = ' ::continue::\n', + }, + } + }, +} + +TEST [[ +while true do + goto continue<??> +end +]] +{ + { + label = 'continue', + kind = define.CompletionItemKind.Keyword, + }, + { + label = 'goto continue ..', + kind = define.CompletionItemKind.Snippet, + additionalTextEdits = { + { + start = 20000, + finish = 20000, + newText = ' ::continue::\n', + } + } + }, +} + +TEST [[ +while true do + goto continue<??> + ::continue:: +end +]] +{ + { + label = 'continue', + kind = define.CompletionItemKind.Keyword, + }, + { + label = 'goto continue ..', + kind = define.CompletionItemKind.Snippet, + additionalTextEdits = { + } + }, +} |