summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-03-31 10:42:27 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-03-31 10:42:27 +0800
commit51a43979dc277e1a4418725cd001b5520d84588d (patch)
treeeefbf7dc228820ff9aea59134022a0bbe5ecf7e5 /test
parentd36ceb32aeb95261be630157cbf7389c0d3c8085 (diff)
downloadlua-language-server-51a43979dc277e1a4418725cd001b5520d84588d.zip
#450 add dummy param into param list
Diffstat (limited to 'test')
-rw-r--r--test/completion/init.lua6
-rw-r--r--test/type_inference/init.lua24
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)
+]]