summaryrefslogtreecommitdiff
path: root/server/test/crossfile
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-26 14:12:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-26 14:12:30 +0800
commit6d929d7682fd297f49773efef5be039f2831427a (patch)
tree064eb34b4181ff39be81a83172619275798c4068 /server/test/crossfile
parentb6568168f9419f8c3c14f966b4520b73a03f5bd0 (diff)
downloadlua-language-server-6d929d7682fd297f49773efef5be039f2831427a.zip
合并child与info
Diffstat (limited to 'server/test/crossfile')
-rw-r--r--server/test/crossfile/references.lua51
1 files changed, 51 insertions, 0 deletions
diff --git a/server/test/crossfile/references.lua b/server/test/crossfile/references.lua
index abdf3a35..cc57842c 100644
--- a/server/test/crossfile/references.lua
+++ b/server/test/crossfile/references.lua
@@ -99,6 +99,11 @@ function TEST(data)
end
local vm = lsp:loadVM(mainUri)
+
+ while lsp._needCompile[1] do
+ lsp:compileVM(lsp._needCompile[1])
+ end
+
assert(vm)
local result = core.references(vm, pos, true)
if expect then
@@ -124,3 +129,49 @@ TEST {
]],
},
}
+
+TEST {
+ {
+ path = 'a.lua',
+ content = [[
+ local <!f!> = require 'lib'
+ ]],
+ },
+ {
+ path = 'lib.lua',
+ content = [[
+ return <?function ()
+ end?>
+ ]],
+ },
+}
+
+TEST {
+ {
+ path = 'a.lua',
+ content = [[
+ <!ROOT!> = 1
+ ]],
+ },
+ {
+ path = 'b.lua',
+ content = [[
+ print(<?ROOT?>)
+ ]],
+ },
+}
+
+TEST {
+ {
+ path = 'a.lua',
+ content = [[
+ <?ROOT?> = 1
+ ]],
+ },
+ {
+ path = 'b.lua',
+ content = [[
+ print(<!ROOT!>)
+ ]],
+ },
+}