diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-23 22:44:35 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-23 22:44:35 +0800 |
commit | ccc724254cce1b0a8577424051735f9b722bd6f2 (patch) | |
tree | 22cce8462c027fd36918aea357385dd475e9d2e2 /test/completion | |
parent | 87c9daacef9600e0fd681716c0b2e21898829df7 (diff) | |
download | lua-language-server-ccc724254cce1b0a8577424051735f9b722bd6f2.zip |
xpcall
Diffstat (limited to 'test/completion')
-rw-r--r-- | test/completion/common.lua | 74 |
1 files changed, 70 insertions, 4 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua index 7d6ba0c8..0dfabb07 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -2766,7 +2766,7 @@ xx@pcall<??> textEdit = { start = 3, finish = 8, - newText = 'pcall(xx)', + newText = 'pcall(xx$1)$0', }, additionalTextEdits = { { @@ -2775,7 +2775,7 @@ xx@pcall<??> newText = '' } } - } + }, } TEST [[ @@ -2797,7 +2797,7 @@ xx()@pcall<??> newText = '' } } - } + }, } TEST [[ @@ -2819,5 +2819,71 @@ xx(1, 2, 3)@pcall<??> newText = '' } } - } + }, +} + +TEST [[ +xx@xpcall<??> +]] +{ + [1] = { + label = 'xpcall', + kind = define.CompletionItemKind.Event, + textEdit = { + start = 3, + finish = 9, + newText = 'xpcall(xx, ${1:debug.traceback}$2)$0', + }, + additionalTextEdits = { + { + start = 0, + finish = 3, + newText = '' + } + } + }, +} + +TEST [[ +xx()@xpcall<??> +]] +{ + [1] = { + label = 'xpcall', + kind = define.CompletionItemKind.Event, + textEdit = { + start = 5, + finish = 11, + newText = 'xpcall(xx, ${1:debug.traceback})$0', + }, + additionalTextEdits = { + { + start = 0, + finish = 5, + newText = '' + } + } + }, +} + +TEST [[ +xx(1, 2, 3)@xpcall<??> +]] +{ + [1] = { + label = 'xpcall', + kind = define.CompletionItemKind.Event, + textEdit = { + start = 12, + finish = 18, + newText = 'xpcall(xx, ${1:debug.traceback}, 1, 2, 3)$0', + }, + additionalTextEdits = { + { + start = 0, + finish = 12, + newText = '' + } + } + }, } |