diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-05 19:12:20 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-05 19:12:20 +0800 |
commit | b41c1e1f26804469d322312597f46ccb81ec0674 (patch) | |
tree | e288a05c30c41b9a2d95ab64a0f1bd98796658db /test | |
parent | 2f53b27a582059ae990525042caed656f82a75c0 (diff) | |
download | lua-language-server-b41c1e1f26804469d322312597f46ccb81ec0674.zip |
close #144
Diffstat (limited to 'test')
-rw-r--r-- | test/crossfile/completion.lua | 41 |
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 |