diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-17 14:48:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-17 14:48:16 +0800 |
commit | 1bb4040b7ff975f20ec151d6b97ecf6e044bfb2a (patch) | |
tree | d6bb113580612a45d9e486f1ad227f8a91076f75 /script-beta/core | |
parent | 5a9dd92de2e1caed7cc66c6448a0ee951b47bd4e (diff) | |
download | lua-language-server-1bb4040b7ff975f20ec151d6b97ecf6e044bfb2a.zip |
hover时若 x.y 中的x是全局变量,则不找x的class
Diffstat (limited to 'script-beta/core')
-rw-r--r-- | script-beta/core/hover/name.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/script-beta/core/hover/name.lua b/script-beta/core/hover/name.lua index 230de253..e5bd6f66 100644 --- a/script-beta/core/hover/name.lua +++ b/script-beta/core/hover/name.lua @@ -17,12 +17,12 @@ local function asLocal(source) end local function asField(source, oop) - local class = vm.getClass(source.node, 'deep') + local class + if source.node.type ~= 'getglobal' then + class = vm.getClass(source.node, 'deep') + end local node = class or guide.getName(source.node) or '?' local method = guide.getName(source) - if node:sub(-1) == '*' then - node = node:sub(1, -2) - end if oop then return ('%s:%s'):format(node, method) else |