summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-23 15:32:35 +0800
committersumneko <sumneko@hotmail.com>2019-04-23 15:32:35 +0800
commit246711c5919aff9c471939285685827831b8fd08 (patch)
treed3474721299747ecb6af989ebea444ccd637c261 /server/test
parent67a10cf8b7eb64579d9c7ba4ab0c28a5389a72fd (diff)
downloadlua-language-server-246711c5919aff9c471939285685827831b8fd08.zip
一定不会require到自己
Diffstat (limited to 'server/test')
-rw-r--r--server/test/crossfile/completion.lua22
-rw-r--r--server/test/crossfile/definition.lua16
2 files changed, 38 insertions, 0 deletions
diff --git a/server/test/crossfile/completion.lua b/server/test/crossfile/completion.lua
index cc31ed5d..2c781e9e 100644
--- a/server/test/crossfile/completion.lua
+++ b/server/test/crossfile/completion.lua
@@ -510,3 +510,25 @@ TEST {
main = true,
},
}
+
+TEST {
+ {
+ path = 'xxx.lua',
+ content = ''
+ },
+ {
+ path = 'xxxx.lua',
+ content = [[
+ require 'xx$'
+ ]],
+ main = true,
+ },
+ completion = {
+ {
+ label = 'xxx',
+ kind = CompletionItemKind.Reference,
+ documentation = 'xxx.lua',
+ textEdit = EXISTS,
+ },
+ }
+}
diff --git a/server/test/crossfile/definition.lua b/server/test/crossfile/definition.lua
index e49308a1..06512f9b 100644
--- a/server/test/crossfile/definition.lua
+++ b/server/test/crossfile/definition.lua
@@ -361,6 +361,22 @@ TEST {
TEST {
{
+ path = 'a/xxx.lua',
+ content = [[
+ return <!function () end!>
+ ]]
+ },
+ {
+ path = 'b/xxx.lua',
+ content = [[
+ local <?f?> = require 'xxx'
+ return function () end
+ ]]
+ }
+}
+
+TEST {
+ {
path = 'a.lua',
content = [[
---@class Class