summaryrefslogtreecommitdiff
path: root/script-beta/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-17 14:48:16 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-17 14:48:16 +0800
commit1bb4040b7ff975f20ec151d6b97ecf6e044bfb2a (patch)
treed6bb113580612a45d9e486f1ad227f8a91076f75 /script-beta/core
parent5a9dd92de2e1caed7cc66c6448a0ee951b47bd4e (diff)
downloadlua-language-server-1bb4040b7ff975f20ec151d6b97ecf6e044bfb2a.zip
hover时若 x.y 中的x是全局变量,则不找x的class
Diffstat (limited to 'script-beta/core')
-rw-r--r--script-beta/core/hover/name.lua8
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