summaryrefslogtreecommitdiff
path: root/server/src/matcher/vm.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-21 10:37:06 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-21 10:37:06 +0800
commit9711dcfcafceca6426e650a99f9d580ba6be58c1 (patch)
tree61e57de6e5793b6150b0463d5e76a676809a7a05 /server/src/matcher/vm.lua
parent8254afb1d359e8db10883f56f1474c7a7a7e3779 (diff)
downloadlua-language-server-9711dcfcafceca6426e650a99f9d580ba6be58c1.zip
会优先找相似路径的文件
Diffstat (limited to 'server/src/matcher/vm.lua')
-rw-r--r--server/src/matcher/vm.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/src/matcher/vm.lua b/server/src/matcher/vm.lua
index b04089af..50de4041 100644
--- a/server/src/matcher/vm.lua
+++ b/server/src/matcher/vm.lua
@@ -1228,7 +1228,7 @@ function mt:loadRequires()
for value, strValue in pairs(copy) do
local str = strValue.value
if type(str) == 'string' then
- local uri = self.lsp.workspace:searchPath(str)
+ local uri = self.lsp.workspace:searchPath(self.uri, str)
-- 如果循环require,这里会返回nil
-- 会当场编译VM
local destVM = self.lsp:loadVM(uri)
@@ -1246,7 +1246,7 @@ function mt:tryLoadRequires()
for value, strValue in pairs(self.requires) do
local str = strValue.value
if type(str) == 'string' then
- local uri = self.lsp.workspace:searchPath(str)
+ local uri = self.lsp.workspace:searchPath(self.uri, str)
-- 如果取不到VM(不编译),则做个标记,之后再取一次
local destVM = self.lsp:getVM(uri)
if destVM then