From 7c4840555590078785a118065abf11b9832e95e7 Mon Sep 17 00:00:00 2001 From: sumneko Date: Fri, 19 Apr 2019 17:04:28 +0800 Subject: =?UTF-8?q?=E5=85=81=E8=AE=B8=20=5FG.xx=20=E5=BD=A2=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E5=85=A8=E5=B1=80=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/diagnostics.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'server/src/core/diagnostics.lua') diff --git a/server/src/core/diagnostics.lua b/server/src/core/diagnostics.lua index 33037d5f..d49f8da2 100644 --- a/server/src/core/diagnostics.lua +++ b/server/src/core/diagnostics.lua @@ -256,23 +256,23 @@ function mt:searchLowercaseGlobal(callback) for name in pairs(library.global) do definedGlobal[name] = true end - local uri = self.vm.uri - local envValue = self.vm.env:getValue() - envValue:eachInfo(function (info, src) - if info.type == 'set child' and src.uri == uri then - local name = info[1] + self.vm:eachSource(function (source) + if source.type == 'name' + and source:get 'parent' + and not source:get 'simple' + and not source:get 'table index' + and source:action() == 'set' + then + local name = source[1] if definedGlobal[name] then return end - if type(name) ~= 'string' then - return - end local first = name:match '%w' if not first then return end if first:match '%l' then - callback(src.start, src.finish) + callback(source.start, source.finish) end end end) -- cgit v1.2.3