diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-07 09:55:24 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-07 09:55:31 +0800 |
commit | 3238be9f9828d3728fb81e2284ac2a5c2c9b3208 (patch) | |
tree | 704453298c91800648ac580a97dec332884981be /test | |
parent | 48c7a420e07fff03a88542c3b22f6f61b3cfc95b (diff) | |
download | lua-language-server-3238be9f9828d3728fb81e2284ac2a5c2c9b3208.zip |
update auto require
Diffstat (limited to 'test')
-rw-r--r-- | test/crossfile/completion.lua | 37 |
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 |