summaryrefslogtreecommitdiff
path: root/server-beta/src/parser/guide.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-09-30 16:28:26 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-09-30 16:28:26 +0800
commit4af522a597345cd26e1d4a64bbfac3074f16235b (patch)
tree64a151711cdc877a003580b867f004012e6d932a /server-beta/src/parser/guide.lua
parent225e1aaeda6f956cc63f689df3a03b31e5804d44 (diff)
downloadlua-language-server-4af522a597345cd26e1d4a64bbfac3074f16235b.zip
整理代码
Diffstat (limited to 'server-beta/src/parser/guide.lua')
-rw-r--r--server-beta/src/parser/guide.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/server-beta/src/parser/guide.lua b/server-beta/src/parser/guide.lua
index 3fb34d51..49b43f92 100644
--- a/server-beta/src/parser/guide.lua
+++ b/server-beta/src/parser/guide.lua
@@ -349,4 +349,13 @@ function m.lineRange(lines, row)
return line.start + 1, line.finish
end
+function m.getKeyName(obj)
+ if obj.type == 'getglobal' or obj.type == 'setglobal' then
+ return obj[1]
+ elseif obj.type == 'getfield' or obj.type == 'setfield' then
+ return obj.field[1]
+ end
+ return nil
+end
+
return m