summaryrefslogtreecommitdiff
path: root/test/crossfile
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-21 20:22:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-21 20:22:08 +0800
commit970418953e1d988080113b30b529a787e4c66bbb (patch)
tree54d7d0f6e7e1bdc155b4e8f633b88da78a3a3689 /test/crossfile
parente7aa360492f0cde296281c3b2518691fbfc761e4 (diff)
downloadlua-language-server-970418953e1d988080113b30b529a787e4c66bbb.zip
fix
Diffstat (limited to 'test/crossfile')
-rw-r--r--test/crossfile/hover.lua31
1 files changed, 31 insertions, 0 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',
+ }
+}