summaryrefslogtreecommitdiff
path: root/script/workspace/require-path.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-02-15 15:08:51 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-02-15 15:09:15 +0800
commit08a8a5ddb05610e282b3d4bed438aa779a0789f2 (patch)
tree7380248f928dd0bb8505bbe99b66d0276987a22d /script/workspace/require-path.lua
parent30a3c34fdc23bd8b6d08e0782971d53004f8c25e (diff)
downloadlua-language-server-08a8a5ddb05610e282b3d4bed438aa779a0789f2.zip
should normalize path in filewatch
Diffstat (limited to 'script/workspace/require-path.lua')
-rw-r--r--script/workspace/require-path.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua
index e51d1219..c319cbad 100644
--- a/script/workspace/require-path.lua
+++ b/script/workspace/require-path.lua
@@ -81,7 +81,7 @@ function mt:getRequireResultByPath(path)
for _, searcher in ipairs(searchers) do
local isAbsolute = searcher:match '^[/\\]'
or searcher:match '^%a+%:'
- searcher = workspace.normalize(searcher)
+ searcher = files.normalize(searcher)
if searcher:sub(1, 1) == '.' then
strict = true
end
@@ -158,7 +158,7 @@ function mt:getVisiblePath(path)
and not self.scp:isLinkedUri(uri) then
return {}
end
- path = workspace.normalize(path)
+ path = files.normalize(path)
local result = self.visibleCache[path]
if not result then
result = self:getRequireResultByPath(path)
@@ -196,7 +196,7 @@ function mt:searchUrisByRequireName(name)
for _, searcher in ipairs(searchers) do
local fspath = searcher:gsub('%?', (path:gsub('%%', '%%%%')))
- fspath = workspace.normalize(fspath)
+ fspath = files.normalize(fspath)
local tail = '/' .. furi.encode(fspath):gsub('^file:[/]*', '')
for uri in files.eachFile(self.scp.uri) do
if not searcherMap[uri]
@@ -212,7 +212,7 @@ function mt:searchUrisByRequireName(name)
or relative == '/'
or relative == '' then
results[#results+1] = uri
- searcherMap[uri] = workspace.normalize(relative .. searcher)
+ searcherMap[uri] = files.normalize(relative .. searcher)
end
end
end
@@ -294,7 +294,7 @@ function m.isMatchedUri(suri, uri, name)
for _, searcher in ipairs(searchers) do
local fspath = searcher:gsub('%?', (path:gsub('%%', '%%%%')))
- fspath = workspace.normalize(fspath)
+ fspath = files.normalize(fspath)
local tail = '/' .. furi.encode(fspath):gsub('^file:[/]*', '')
if util.stringEndWith(uri, tail) then
local parentUri = files.getLibraryUri(suri, uri) or uri