summaryrefslogtreecommitdiff
path: root/test/crossfile
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-08-23 11:08:21 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-08-23 11:08:21 +0800
commit0d902298c0b4b26978e765665431d6d55d4b9b90 (patch)
tree3d611db4b23ad75fbd98cc99dec30a680ccfa7d6 /test/crossfile
parent04b6327f39fc5354caa984b666644333ab52f9cc (diff)
downloadlua-language-server-0d902298c0b4b26978e765665431d6d55d4b9b90.zip
resolve #518 `Lua.completion.requireSeparator`
Diffstat (limited to 'test/crossfile')
-rw-r--r--test/crossfile/completion.lua26
-rw-r--r--test/crossfile/hover.lua36
2 files changed, 62 insertions, 0 deletions
diff --git a/test/crossfile/completion.lua b/test/crossfile/completion.lua
index 927cad3c..d26398ca 100644
--- a/test/crossfile/completion.lua
+++ b/test/crossfile/completion.lua
@@ -302,6 +302,32 @@ TEST {
}
}
+local originSeparator = config.get 'Lua.completion.requireSeparator'
+config.set('Lua.completion.requireSeparator', '/')
+TEST {
+ {
+ path = 'abc.lua',
+ content = '',
+ },
+ {
+ path = 'abc/init.lua',
+ content = '',
+ },
+ {
+ path = 'test.lua',
+ content = 'require "abc/i$"',
+ main = true,
+ },
+ completion = {
+ {
+ label = 'abc/init',
+ kind = CompletionItemKind.Reference,
+ textEdit = EXISTS,
+ },
+ }
+}
+config.set('Lua.completion.requireSeparator', originSeparator)
+
TEST {
{
path = 'core/core.lua',
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index f00f6e35..2ceeb597 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -108,6 +108,42 @@ TEST {
---
* [Folder\a.lua](file:///Folder/a.lua) (搜索路径: `Folder\?.lua`)]],
}
+
+TEST {
+ {
+ path = 'Folder/a.lua',
+ content = '',
+ },
+ {
+ path = 'b.lua',
+ content = 'require <?"Folder.a"?>',
+ },
+ hover = [[
+```lua
+8 个字节
+```
+
+---
+* [Folder\a.lua](file:///Folder/a.lua) (搜索路径: `?.lua`)]],
+}
+
+TEST {
+ {
+ path = 'Folder/a.lua',
+ content = '',
+ },
+ {
+ path = 'b.lua',
+ content = 'require <?"Folder/a"?>',
+ },
+ hover = [[
+```lua
+8 个字节
+```
+
+---
+* [Folder\a.lua](file:///Folder/a.lua) (搜索路径: `?.lua`)]],
+}
else
TEST {
{