summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-24 15:13:40 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-24 15:13:40 +0800
commit90d2f4190567891a2497cee80186657d416b19b0 (patch)
treebe8f3d13381ea347e8a605da54c841d19d1e53cb /test/completion
parent91a09a1f08cbafe60212b13f5c62fa64f0d5ec4d (diff)
downloadlua-language-server-90d2f4190567891a2497cee80186657d416b19b0.zip
@method
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/common.lua66
1 files changed, 66 insertions, 0 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index 0dfabb07..d3e56616 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -2887,3 +2887,69 @@ xx(1, 2, 3)@xpcall<??>
}
},
}
+
+TEST [[
+xx@function<??>
+]]
+{
+ [1] = {
+ label = 'function',
+ kind = define.CompletionItemKind.Event,
+ textEdit = {
+ start = 3,
+ finish = 11,
+ newText = 'function xx($1)\n\t$0\nend',
+ },
+ additionalTextEdits = {
+ {
+ start = 0,
+ finish = 3,
+ newText = ''
+ }
+ }
+ },
+}
+
+TEST [[
+xx.yy@method<??>
+]]
+{
+ [1] = {
+ label = 'method',
+ kind = define.CompletionItemKind.Event,
+ textEdit = {
+ start = 6,
+ finish = 12,
+ newText = 'function xx:yy($1)\n\t$0\nend',
+ },
+ additionalTextEdits = {
+ {
+ start = 0,
+ finish = 6,
+ newText = ''
+ }
+ }
+ },
+}
+
+TEST [[
+xx:yy@method<??>
+]]
+{
+ [1] = {
+ label = 'method',
+ kind = define.CompletionItemKind.Event,
+ textEdit = {
+ start = 6,
+ finish = 12,
+ newText = 'function xx:yy($1)\n\t$0\nend',
+ },
+ additionalTextEdits = {
+ {
+ start = 0,
+ finish = 6,
+ newText = ''
+ }
+ }
+ },
+}