diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-03-15 18:42:49 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-03-15 18:42:49 +0800 |
commit | 20d4be8bc74d6a78372f50112288fb6c4406b841 (patch) | |
tree | 0cac43175674535150e72da3abafe695b586eda0 /script/workspace | |
parent | d1363a89da92c3112820da25914d63cb718f65cf (diff) | |
download | lua-language-server-20d4be8bc74d6a78372f50112288fb6c4406b841.zip |
use real path in scanning
non-Windows also check real path
Diffstat (limited to 'script/workspace')
-rw-r--r-- | script/workspace/workspace.lua | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 80df7d9c..934c0735 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -241,8 +241,9 @@ function m.awaitLoadFile(uri) log.info('Scan files at:', uri) ---@async native:scan(furi.decode(uri), function (path) - scp:get('cachedUris')[furi.encode(path)] = true - ld:loadFile(furi.encode(path)) + local uri = files.getRealUri(furi.encode(path)) + scp:get('cachedUris')[uri] = true + ld:loadFile(uri) end) ld:loadAll() end @@ -282,8 +283,9 @@ function m.awaitPreload(scp) log.info('Scan files at:', scp:getName()) ---@async native:scan(furi.decode(scp.uri), function (path) - scp:get('cachedUris')[furi.encode(path)] = true - ld:loadFile(furi.encode(path)) + local uri = files.getRealUri(furi.encode(path)) + scp:get('cachedUris')[uri] = true + ld:loadFile(uri) end) end @@ -292,8 +294,9 @@ function m.awaitPreload(scp) scp:addLink(libMatcher.uri) ---@async libMatcher.matcher:scan(furi.decode(libMatcher.uri), function (path) - scp:get('cachedUris')[furi.encode(path)] = true - ld:loadFile(furi.encode(path), libMatcher.uri) + local uri = files.getRealUri(furi.encode(path)) + scp:get('cachedUris')[uri] = true + ld:loadFile(uri, libMatcher.uri) end) scp:gc(fw.watch(furi.decode(libMatcher.uri))) end |