summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-04-22 00:13:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-04-22 00:13:30 +0800
commit78899471be2e3cb1f5bda56ad5d3d8d084534515 (patch)
tree22d7252b085ce4273cb563eff050eeb8a7c6c7a3 /test
parent7dd6a5440cb40082f74a865c79d06b2ab8a9c7c1 (diff)
downloadlua-language-server-78899471be2e3cb1f5bda56ad5d3d8d084534515.zip
stash
Diffstat (limited to 'test')
-rw-r--r--test/basic/linker.txt24
-rw-r--r--test/references/init.lua15
2 files changed, 35 insertions, 4 deletions
diff --git a/test/basic/linker.txt b/test/basic/linker.txt
index 284623cd..86930dd1 100644
--- a/test/basic/linker.txt
+++ b/test/basic/linker.txt
@@ -82,7 +82,23 @@ local <!x!> = f()
```
'd|A'
-'f|1:1'
-'f|1' + ':1'
-'l|1' + ':1'
-'s|1' + ':1'
+'f|1|#1'
+'f|1' + '|#1'
+'l|1' + '|#1'
+'s|1' + '|#1'
+
+```lua
+---@generic T
+---@param a T
+---@return T
+local function f(a) end
+
+local <?c?>
+
+local <!v!> = f(c)
+```
+
+'l1'
+'l2|@1'
+'f|1|@1'
+'f|1|#1'
diff --git a/test/references/init.lua b/test/references/init.lua
index 31aa0cb7..f6785984 100644
--- a/test/references/init.lua
+++ b/test/references/init.lua
@@ -359,6 +359,21 @@ local a, b = f()
return a.x, b.<!x!>
]]
+-- TODO 支持泛型
+do return end
+TEST [[
+---@class Dog
+local <?Dog?> = {}
+
+---@generic T
+---@param type1 T
+---@return T
+function foobar(type1)
+end
+
+local <!v1!> = foobar(<!Dog!>)
+]]
+
TEST [[
---@class Dog
local Dog = {}