summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-05 19:12:20 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-05 19:12:20 +0800
commitb41c1e1f26804469d322312597f46ccb81ec0674 (patch)
treee288a05c30c41b9a2d95ab64a0f1bd98796658db /test
parent2f53b27a582059ae990525042caed656f82a75c0 (diff)
downloadlua-language-server-b41c1e1f26804469d322312597f46ccb81ec0674.zip
close #144
Diffstat (limited to 'test')
-rw-r--r--test/crossfile/completion.lua41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/crossfile/completion.lua b/test/crossfile/completion.lua
index 67c6d9e6..353abf33 100644
--- a/test/crossfile/completion.lua
+++ b/test/crossfile/completion.lua
@@ -600,3 +600,44 @@ local z: {}
},
}
}
+
+Cared['detail'] = true
+Cared['additionalTextEdits'] = true
+TEST {
+ {
+ path = 'myfunc.lua',
+ content = [[
+ return function (a, b)
+ end
+ ]]
+ },
+ {
+ path = 'main.lua',
+ main = true,
+ content = [[
+ myfun$
+ ]],
+ },
+ completion = {
+ {
+ label = 'myfunc',
+ kind = CompletionItemKind.Variable,
+ detail = 'function',
+ description = [[
+从 [myfunc.lua](file:///myfunc.lua) 中导入
+```lua
+function (a: any, b: any)
+```]],
+ additionalTextEdits = {
+ {
+ start = 0,
+ finish = 0,
+ newText = 'local myfunc = require "myfunc"\n'
+ }
+ }
+ }
+ }
+}
+
+Cared['detail'] = nil
+Cared['additionalTextEdits'] = nil