diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-26 15:14:24 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-26 15:14:24 +0800 |
commit | c550a2051e6302c92ad1c2cd8c0b808320d07b5f (patch) | |
tree | 34442e67d60ae120f3454f485591e05505f82a85 /server/src/service.lua | |
parent | 88b9936cfef9f84580cae3ba2f346c95f8f27103 (diff) | |
download | lua-language-server-c550a2051e6302c92ad1c2cd8c0b808320d07b5f.zip |
修改编译顺序
Diffstat (limited to 'server/src/service.lua')
-rw-r--r-- | server/src/service.lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/server/src/service.lua b/server/src/service.lua index 78be0d0c..abac804c 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -120,7 +120,7 @@ function mt:read(mode) return self._input(mode) end -function mt:needCompile(uri, compiled) +function mt:needCompile(uri, compiled, mode) if self._needCompile[uri] then return end @@ -131,7 +131,11 @@ function mt:needCompile(uri, compiled) return end self._needCompile[uri] = compiled - table.insert(self._needCompile, 1, uri) + if mode == 'child' then + table.insert(self._needCompile, uri) + else + table.insert(self._needCompile, 1, uri) + end end function mt:isNeedCompile(uri) @@ -322,12 +326,12 @@ function mt:_compileChain(obj, compiled) end if obj.child then for uri in pairs(obj.child) do - self:needCompile(uri, compiled) + self:needCompile(uri, compiled, 'child') end end if obj.parent then for uri in pairs(obj.parent) do - self:needCompile(uri, compiled) + self:needCompile(uri, compiled, 'parent') end end end @@ -335,7 +339,7 @@ end function mt:_compileGlobal(compiled) local uris = self.global:getAllUris() for _, uri in ipairs(uris) do - self:needCompile(uri, compiled) + self:needCompile(uri, compiled, 'global') end end |