diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-02 17:20:28 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-02 17:20:28 +0800 |
commit | 9a25855cee5238a870f366a2f9d096142b72cd5a (patch) | |
tree | f9d6dff6a4aa6d13109c0c9c3f0b77fcf9c98882 /test | |
parent | 0ba04868b6bed5c213cb0f7e3d732ce59bf930f0 (diff) | |
download | lua-language-server-9a25855cee5238a870f366a2f9d096142b72cd5a.zip |
reslove #460
Diffstat (limited to 'test')
-rw-r--r-- | test/completion/init.lua | 6 | ||||
-rw-r--r-- | test/type_inference/init.lua | 29 |
2 files changed, 32 insertions, 3 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua index 0f96949d..327d72a4 100644 --- a/test/completion/init.lua +++ b/test/completion/init.lua @@ -2580,11 +2580,11 @@ t.GGG$ ]] { { - label = 't.GGG', - kind = define.CompletionItemKind.Enum, + label = 'GGG', + kind = define.CompletionItemKind.Field, }, { - label = 't.GGG()', + label = 'GGG()', kind = define.CompletionItemKind.Function, }, } diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 3ec1cf19..3df73863 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -828,6 +828,13 @@ TEST 'fun():number, boolean' [[ local <?t?> ]] +--[[ +l:value +l:work|&1|&1 +f:|&1|&1 +dfun:|&1 +dn:Class +]] TEST 'Class' [[ ---@class Class @@ -838,3 +845,25 @@ end work(function (<?value?>) end) ]] + +TEST 'Class' [[ +---@class Class + +---@param callback fun(value: Class) +function work(callback) +end + +pcall(work, function (<?value?>) +end) +]] + +TEST 'Class' [[ +---@class Class + +---@param callback fun(value: Class) +function work(callback) +end + +xpcall(work, debug.traceback, function (<?value?>) +end) +]] |