summaryrefslogtreecommitdiff
path: root/script/workspace
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2022-01-23 04:37:55 +0800
committersumneko <sumneko@hotmail.com>2022-01-23 04:37:55 +0800
commit6c97dc8eaae16214a2127f84deca30f2ca6206a3 (patch)
tree7978bfe6dfd5ffc03b3e3228f1e57f43eb16deec /script/workspace
parenta13a30f193b54f32138306463dd8e13d208fb45c (diff)
downloadlua-language-server-6c97dc8eaae16214a2127f84deca30f2ca6206a3.zip
fix #920
Diffstat (limited to 'script/workspace')
-rw-r--r--script/workspace/require-path.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua
index 3454cbf1..98e9e61c 100644
--- a/script/workspace/require-path.lua
+++ b/script/workspace/require-path.lua
@@ -43,7 +43,7 @@ function m.getVisiblePath(suri, path)
local strict = config.get(suri, 'Lua.runtime.pathStrict')
path = workspace.normalize(path)
local uri = furi.encode(path)
- local libraryPath = files.getLibraryPath(uri)
+ local libraryPath = furi.decode(files.getLibraryUri(uri))
local scp = scope.getScope(suri)
local cache = scp:get('visiblePath') or scp:set('visiblePath', {})
if not cache[path] then
@@ -145,10 +145,18 @@ local function removeVisiblePath(uri)
path = workspace.normalize(path)
for _, scp in ipairs(workspace.folders) do
scp:get('visiblePath')[path] = nil
- scp:get('requireName'):dropUri(uri)
+ ---@type collector
+ local clt = scp:get('requireName')
+ if clt then
+ clt:dropUri(uri)
+ end
+ end
+ scope.fallback:get('visiblePath')[path] = nil
+ ---@type collector
+ local clt = scope.fallback:get('requireName')
+ if clt then
+ clt:dropUri(uri)
end
- scope.getScope(nil):get('visiblePath')[path] = nil
- scope.getScope(nil):get('requireName'):dropUri(uri)
end
function m.flush(suri)