summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-11 18:40:05 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-11 18:40:05 +0800
commit87673cfad9e4fc32a2023c24a3d7d2248e8d2916 (patch)
tree486538d26e52b9f90b221bb8ffd9f17ee72b3ba3 /test
parentb8c5d1208f9f276bd168c9a17a2b17105af09107 (diff)
downloadlua-language-server-87673cfad9e4fc32a2023c24a3d7d2248e8d2916.zip
completion: keyword considers expression
Diffstat (limited to 'test')
-rw-r--r--test/completion/init.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua
index 7a797df9..edea2978 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -1059,6 +1059,42 @@ mt:f$
insertText = 'f(${1:a: any}, ${2:b: any}, ${3:c: any})',
},
}
+
+TEST [[
+function$
+]]
+{
+ {
+ label = 'function',
+ kind = define.CompletionItemKind.Keyword,
+ },
+ {
+ label = 'function ()',
+ kind = define.CompletionItemKind.Snippet,
+ insertText = [[
+function $1($2)
+ $0
+end]],
+ },
+}
+
+TEST [[
+local t = function$
+]]
+{
+ {
+ label = 'function',
+ kind = define.CompletionItemKind.Keyword,
+ },
+ {
+ label = 'function ()',
+ kind = define.CompletionItemKind.Snippet,
+ insertText = [[
+function ($1)
+ $0
+end]],
+ },
+}
Cared['insertText'] = false
TEST [[