diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-06-21 20:22:08 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-06-21 20:22:08 +0800 |
commit | 970418953e1d988080113b30b529a787e4c66bbb (patch) | |
tree | 54d7d0f6e7e1bdc155b4e8f633b88da78a3a3689 /test | |
parent | e7aa360492f0cde296281c3b2518691fbfc761e4 (diff) | |
download | lua-language-server-970418953e1d988080113b30b529a787e4c66bbb.zip |
fix
Diffstat (limited to 'test')
-rw-r--r-- | test/crossfile/hover.lua | 31 | ||||
-rw-r--r-- | test/type_inference/init.lua | 8 |
2 files changed, 31 insertions, 8 deletions
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua index 7c83276e..e736e98c 100644 --- a/test/crossfile/hover.lua +++ b/test/crossfile/hover.lua @@ -795,3 +795,34 @@ end name = 'k', } } + +TEST { + { + path = 'a.lua', + content = [[ +---@class string + +---@generic T: table, K, V +---@param t T +---@return fun(table: table<K, V>, index?: K):K, V +---@return T +function tpairs(t) end + ]] + }, + { + path = 'b.lua', + content = [[ +local pairs = require 'a' + +---@type table<string, boolean> +local t + +for <?k?>, v in tpairs(t) do +end + ]] + }, + hover = { + label = [[local k: string]], + name = 'k', + } +} diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 300a68ce..7a968972 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -742,11 +742,3 @@ local <?test?> = Rct.new(Rct) return test ]] - -TEST 'number' [[ ----@alias t table<number, string> ----@type t -local a = {} -for <?x?>, y in pairs(a) do -end -]] |