summaryrefslogtreecommitdiff
path: root/script-beta/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-19 15:10:07 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-19 15:10:07 +0800
commit2c07a7a12bf840e1a90abc117fd5e69866f76fdb (patch)
treee3283b21e345a5d6a3fa062bd1ccb5503888b61f /script-beta/parser
parenta1c4ebfb23152e23bf556811aad39bf917c5cb60 (diff)
downloadlua-language-server-2c07a7a12bf840e1a90abc117fd5e69866f76fdb.zip
自动完成和全局变量相关的一些bug
Diffstat (limited to 'script-beta/parser')
-rw-r--r--script-beta/parser/guide.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 3cbdf4d8..1de15a3b 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -1215,7 +1215,11 @@ function m.isGlobal(source)
end
end
if source.type == 'field' then
- local node = source.parent.node
+ source = source.parent
+ end
+ if source.type == 'getfield'
+ or source.type == 'setfield' then
+ local node = source.node
if node and node.special == '_G' then
return true
end