summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-06-13 18:30:01 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-06-13 18:30:01 +0800
commit4081b303684b95ec27fd833a1cd10978d4ad5e10 (patch)
treebd286d27d262934d662926247e885b56b72bd489 /test/completion
parentcda4ec3f67a93a907752cc98572f0dac9c5dd83e (diff)
downloadlua-language-server-4081b303684b95ec27fd833a1cd10978d4ad5e10.zip
more smart completion for `continue`
fix #2042
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/common.lua70
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 = {
+ }
+ },
+}