summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-07 09:55:24 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-07 09:55:31 +0800
commit3238be9f9828d3728fb81e2284ac2a5c2c9b3208 (patch)
tree704453298c91800648ac580a97dec332884981be /test
parent48c7a420e07fff03a88542c3b22f6f61b3cfc95b (diff)
downloadlua-language-server-3238be9f9828d3728fb81e2284ac2a5c2c9b3208.zip
update auto require
Diffstat (limited to 'test')
-rw-r--r--test/crossfile/completion.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/crossfile/completion.lua b/test/crossfile/completion.lua
index f2487b68..ead28fe2 100644
--- a/test/crossfile/completion.lua
+++ b/test/crossfile/completion.lua
@@ -639,5 +639,42 @@ function (a: any, b: any)
}
}
+
+TEST {
+ {
+ path = 'dir/myfunc.lua',
+ content = [[
+ return function (a, b)
+ end
+ ]]
+ },
+ {
+ path = 'main.lua',
+ main = true,
+ content = [[
+ myfun$
+ ]],
+ },
+ completion = {
+ {
+ label = 'myfunc',
+ kind = CompletionItemKind.Variable,
+ detail = 'function',
+ description = [[
+从 [dir\myfunc.lua](file:///dir/myfunc.lua) 中导入
+```lua
+function (a: any, b: any)
+```]],
+ additionalTextEdits = {
+ {
+ start = 1,
+ finish = 0,
+ newText = 'local myfunc = require "dir.myfunc"\n'
+ }
+ }
+ }
+ }
+}
+
Cared['detail'] = nil
Cared['additionalTextEdits'] = nil