diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-09-30 16:28:26 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-09-30 16:28:26 +0800 |
commit | 4af522a597345cd26e1d4a64bbfac3074f16235b (patch) | |
tree | 64a151711cdc877a003580b867f004012e6d932a /server-beta/src/parser/guide.lua | |
parent | 225e1aaeda6f956cc63f689df3a03b31e5804d44 (diff) | |
download | lua-language-server-4af522a597345cd26e1d4a64bbfac3074f16235b.zip |
整理代码
Diffstat (limited to 'server-beta/src/parser/guide.lua')
-rw-r--r-- | server-beta/src/parser/guide.lua | 9 |
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 |