diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-03-31 10:42:27 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-03-31 10:42:27 +0800 |
commit | 51a43979dc277e1a4418725cd001b5520d84588d (patch) | |
tree | eefbf7dc228820ff9aea59134022a0bbe5ecf7e5 /test | |
parent | d36ceb32aeb95261be630157cbf7389c0d3c8085 (diff) | |
download | lua-language-server-51a43979dc277e1a4418725cd001b5520d84588d.zip |
#450 add dummy param into param list
Diffstat (limited to 'test')
-rw-r--r-- | test/completion/init.lua | 6 | ||||
-rw-r--r-- | test/type_inference/init.lua | 24 |
2 files changed, 29 insertions, 1 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua index ba3c5be5..fb042fe9 100644 --- a/test/completion/init.lua +++ b/test/completion/init.lua @@ -1515,7 +1515,11 @@ end insertText = [[ a ${1:any} ---@param b ${2:any} ----@param c ${3:any}]] +---@param c ${3:any}]], + }, + { + label = 'self', + kind = define.CompletionItemKind.Interface, }, { label = 'a', diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index dde3f319..9265643a 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -630,3 +630,27 @@ function Cls:new() return self end local <?test?> = Cls:new() ]] + +TEST 'Cls' [[ +---@class Cls +local Cls = {} + +---@generic T +---@param self T +---@return T +function Cls.new(self) return self end + +local <?test?> = Cls.new(Cls) +]] + +TEST 'Cls' [[ +---@class Cls +local Cls = {} + +---@generic T +---@param self T +---@return T +function Cls:new() return self end + +local <?test?> = Cls.new(Cls) +]] |