diff options
author | unknown <sumnekosun@intranet.123u.com> | 2019-04-03 10:11:30 +0800 |
---|---|---|
committer | unknown <sumnekosun@intranet.123u.com> | 2019-04-03 10:11:30 +0800 |
commit | d82de95c29f481c5f3734e313d006742c653505b (patch) | |
tree | 465dbbed73945ac5553cd5e15026eb10730362f3 /server/src | |
parent | ffac077ad9591c8f6f1e6e8ea5c2e2334e56d891 (diff) | |
download | lua-language-server-d82de95c29f481c5f3734e313d006742c653505b.zip |
修正require文件缓存的bug
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/workspace.lua | 9 |
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 |