diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-05-13 17:09:50 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-05-13 17:10:26 +0800 |
commit | 1d0a33637635a4f5a9a614c4bb0de17202c2d375 (patch) | |
tree | 828b2932ffc68f06c1f73921e9c62a3220e93b03 /test | |
parent | d7daade3a3b8f4a5e33bca3df7ec0656d93684c2 (diff) | |
download | lua-language-server-1d0a33637635a4f5a9a614c4bb0de17202c2d375.zip |
改成使用自己的 file-uri
Diffstat (limited to 'test')
-rw-r--r-- | test/crossfile/completion.lua | 2 | ||||
-rw-r--r-- | test/crossfile/definition.lua | 2 | ||||
-rw-r--r-- | test/crossfile/document_symbol.lua | 4 | ||||
-rw-r--r-- | test/crossfile/hover.lua | 4 | ||||
-rw-r--r-- | test/crossfile/references.lua | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/test/crossfile/completion.lua b/test/crossfile/completion.lua index cb9f2f65..ab017716 100644 --- a/test/crossfile/completion.lua +++ b/test/crossfile/completion.lua @@ -72,7 +72,7 @@ function TEST(data) local mainBuf local pos for _, info in ipairs(data) do - local uri = uric.encode(fs.path(info.path)) + local uri = uric.encode(ROOT / fs.path(info.path)) local script = info.content if info.main then pos = script:find('$', 1, true) - 1 diff --git a/test/crossfile/definition.lua b/test/crossfile/definition.lua index c765d98a..02209609 100644 --- a/test/crossfile/definition.lua +++ b/test/crossfile/definition.lua @@ -52,7 +52,7 @@ function TEST(datas) local sourceList, sourceUri for i, data in ipairs(datas) do - local uri = uric.encode(fs.path(data.path)) + local uri = uric.encode(ROOT / fs.path(data.path)) local new, list = catch_target(data.content, '!') if new ~= data.content or data.target then if data.target then diff --git a/test/crossfile/document_symbol.lua b/test/crossfile/document_symbol.lua index 997d42c5..23bd6af3 100644 --- a/test/crossfile/document_symbol.lua +++ b/test/crossfile/document_symbol.lua @@ -68,8 +68,8 @@ function TEST(data) local ws = workspace(lsp, 'test') lsp.workspace = ws - local targetUri = uric.encode(fs.path(data[1].path)) - local sourceUri = uric.encode(fs.path(data[2].path)) + local targetUri = uric.encode(ROOT / fs.path(data[1].path)) + local sourceUri = uric.encode(ROOT / fs.path(data[2].path)) lsp:saveText(sourceUri, 1, data[2].content) ws:addFile(uric.decode(sourceUri)) diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua index b0e5a55f..f2560673 100644 --- a/test/crossfile/hover.lua +++ b/test/crossfile/hover.lua @@ -61,10 +61,10 @@ function TEST(data) ws.root = ROOT local targetScript = data[1].content - local targetUri = uric.encode(fs.path(data[1].path)) + local targetUri = uric.encode(ROOT / fs.path(data[1].path)) local sourceScript, sourceList = catch_target(data[2].content, '?') - local sourceUri = uric.encode(fs.path(data[2].path)) + local sourceUri = uric.encode(ROOT / fs.path(data[2].path)) lsp:saveText(targetUri, 1, targetScript) ws:addFile(uric.decode(targetUri)) diff --git a/test/crossfile/references.lua b/test/crossfile/references.lua index 9f81707c..87577770 100644 --- a/test/crossfile/references.lua +++ b/test/crossfile/references.lua @@ -80,11 +80,11 @@ function TEST(data) local pos local expect = {} for _, info in ipairs(data) do - local uri = uric.encode(fs.path(info.path)) + local uri = uric.encode(ROOT / fs.path(info.path)) ws:addFile(uric.decode(uri)) end for _, info in ipairs(data) do - local uri = uric.encode(fs.path(info.path)) + local uri = uric.encode(ROOT / fs.path(info.path)) local script = info.content local list = catch_target(script) for _, location in ipairs(list) do |