diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-19 16:01:08 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-19 16:01:08 +0800 |
commit | d7d69d8366f9d5404db6a0583672efd75b514700 (patch) | |
tree | 2fd04b18a1b337e7de38ea572182bb681329cc72 /server | |
parent | 55b9f79c900990756b2948efabb85d1651ff61ec (diff) | |
download | lua-language-server-d7d69d8366f9d5404db6a0583672efd75b514700.zip |
加个检查
Diffstat (limited to 'server')
-rw-r--r-- | server/src/core/implementation.lua | 2 | ||||
-rw-r--r-- | server/src/service.lua | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/server/src/core/implementation.lua b/server/src/core/implementation.lua index 5385d9f9..36a990ee 100644 --- a/server/src/core/implementation.lua +++ b/server/src/core/implementation.lua @@ -94,7 +94,7 @@ end local function parseValue(vm, source, lsp) local value = source:bindValue() - if value.uri ~= vm.uri then + if value.uri ~= '' and value.uri ~= vm.uri then return parseValueCrossFile(vm, source, lsp) end local positions = {} diff --git a/server/src/service.lua b/server/src/service.lua index 42f0e1a0..74ff98e7 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -540,8 +540,12 @@ function mt:_testMemory() end self._clock = os.clock() local cachedVM = 0 - for _ in pairs(self._file) do - cachedVM = cachedVM + 1 + local cachedSource = 0 + for _, obj in pairs(self._file) do + if obj.vm then + cachedVM = cachedVM + 1 + cachedSource = cachedSource + #obj.vm.sources + end end local aliveVM = 0 local deadVM = 0 @@ -569,12 +573,14 @@ function mt:_testMemory() CachedVM: [%d]\n\z AlivedVM: [%d]\n\z DeadVM: [%d]\n\z + CachedSrc:[%d]\n\z AlivedSrc:[%d]\n\z DeadSrc: [%d]'):format( mem, cachedVM, aliveVM, deadVM, + cachedSource, alivedSource, deadSource )) |