summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorunknown <sumnekosun@intranet.123u.com>2019-04-03 10:11:30 +0800
committerunknown <sumnekosun@intranet.123u.com>2019-04-03 10:11:30 +0800
commitd82de95c29f481c5f3734e313d006742c653505b (patch)
tree465dbbed73945ac5553cd5e15026eb10730362f3 /server/src
parentffac077ad9591c8f6f1e6e8ea5c2e2334e56d891 (diff)
downloadlua-language-server-d82de95c29f481c5f3734e313d006742c653505b.zip
修正require文件缓存的bug
Diffstat (limited to 'server/src')
-rw-r--r--server/src/workspace.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/src/workspace.lua b/server/src/workspace.lua
index 4ab8b6d2..01532c7a 100644
--- a/server/src/workspace.lua
+++ b/server/src/workspace.lua
@@ -268,8 +268,8 @@ function mt:matchPath(baseUri, input)
end
function mt:searchPath(baseUri, str)
- if self.searched[str] then
- return self.searched[str]
+ if self.searched[baseUri] and self.searched[baseUri][str] then
+ return self.searched[baseUri][str]
end
str = str:gsub('%.', '/')
local searchers = {}
@@ -279,7 +279,10 @@ function mt:searchPath(baseUri, str)
local uri = self:findPath(baseUri, searchers)
if uri then
- self.searched[str] = uri
+ if not self.searched[baseUri] then
+ self.searched[baseUri] = {}
+ end
+ self.searched[baseUri][str] = uri
end
return uri
end