summaryrefslogtreecommitdiff
path: root/script/core/completion.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-24 10:37:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-24 10:37:12 +0800
commit6467232bd9e5099be378b7a17bd183ef810c0d2d (patch)
tree8f702eb792162f69f1f86f96f8b7ab8c31d50d99 /script/core/completion.lua
parent6597f469276880db153b301da3daf7a79bd2f98e (diff)
downloadlua-language-server-6467232bd9e5099be378b7a17bd183ef810c0d2d.zip
remove optimization of fastGlobal
Diffstat (limited to 'script/core/completion.lua')
-rw-r--r--script/core/completion.lua14
1 files changed, 4 insertions, 10 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index faa8fb41..4983cd34 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -417,16 +417,7 @@ local function checkFieldOfRefs(refs, ast, word, start, offset, parent, oop, res
goto CONTINUE
end
if isSameSource(ast, src, start) then
- -- 由于fastGlobal的优化,全局变量只会找出一个值,有可能找出自己
- -- 所以遇到自己的时候重新找一下有没有其他定义
- if not isGlobal then
- goto CONTINUE
- end
- if #vm.getGlobals(key) <= 1 then
- goto CONTINUE
- elseif not vm.isSet(src) then
- src = vm.getGlobalSets(key)[1] or src
- end
+ goto CONTINUE
end
local name = key:sub(3)
if locals and locals[name] then
@@ -441,6 +432,9 @@ local function checkFieldOfRefs(refs, ast, word, start, offset, parent, oop, res
count = count + 1
goto CONTINUE
end
+ if vm.isDeprecated(src) then
+ goto CONTINUE
+ end
if src.type == 'tablefield'
or src.type == 'setfield'
or src.type == 'tableindex'