diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-09-30 17:07:36 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-09-30 17:07:36 +0800 |
commit | 4e01c062182d333ea7d7007c2f44d036993d9c0f (patch) | |
tree | 704ff507105783ea76f840e938cd0955c6833c99 /server-beta/src/core | |
parent | 8397d997279ed8087dde359cf4bfd14a4aaaa46d (diff) | |
download | lua-language-server-4e01c062182d333ea7d7007c2f44d036993d9c0f.zip |
支持method
Diffstat (limited to 'server-beta/src/core')
-rw-r--r-- | server-beta/src/core/engineer.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server-beta/src/core/engineer.lua b/server-beta/src/core/engineer.lua index c5ed636c..6baa0d20 100644 --- a/server-beta/src/core/engineer.lua +++ b/server-beta/src/core/engineer.lua @@ -14,7 +14,9 @@ mt.type = 'engineer' mt['local'] = function (self, source, mode, callback) if mode == 'def' then - callback(source, 'local') + if source.tag ~= 'self' then + callback(source, 'local') + end if source.ref then for _, ref in ipairs(source.ref) do if ref.type == 'setlocal' then @@ -22,6 +24,11 @@ mt['local'] = function (self, source, mode, callback) end end end + if source.tag == 'self' then + local method = source.method + local node = method.node + self:search(node, node.type, mode, callback) + end end end mt['getlocal'] = function (self, source, mode, callback) |