summaryrefslogtreecommitdiff
path: root/test/crossfile
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-21 17:27:21 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-21 17:27:21 +0800
commit693226b24fb0888c12e89e6b413bf21522eed423 (patch)
tree76e273299c5065bfc3fc958894721bcd0712d3f2 /test/crossfile
parent600f5e09cd79585aba80ee692ca0a0995b874451 (diff)
downloadlua-language-server-693226b24fb0888c12e89e6b413bf21522eed423.zip
limit cross file
Diffstat (limited to 'test/crossfile')
-rw-r--r--test/crossfile/hover.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index e81494ff..7c83276e 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -762,3 +762,36 @@ function f()
name = 'food',
description = "@*return* — this is a tab `\t`"
}}
+
+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
+local function pairs(t) end
+
+return pairs
+ ]]
+ },
+ {
+ path = 'b.lua',
+ content = [[
+local pairs = require 'a'
+
+---@type table<string, boolean>
+local t
+
+for <?k?>, v in pairs(t) do
+end
+ ]]
+ },
+ hover = {
+ label = [[local k: string]],
+ name = 'k',
+ }
+}