summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-15 17:01:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-15 17:01:18 +0800
commitbe19b8b2e6246bd53e08df3fabaa8442b3422dc6 (patch)
tree872596a8b604029b724a336078595c6f57321668 /script
parente4e5edbb3a9a53a7dffb4ab22ff8f6a0f69ce35b (diff)
downloadlua-language-server-be19b8b2e6246bd53e08df3fabaa8442b3422dc6.zip
fix endless loop
Diffstat (limited to 'script')
-rw-r--r--script/core/hover/name.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/script/core/hover/name.lua b/script/core/hover/name.lua
index 49260e8f..0de13c9a 100644
--- a/script/core/hover/name.lua
+++ b/script/core/hover/name.lua
@@ -99,9 +99,10 @@ function buildName(source, oop)
if source.type == 'doc.field' then
return asDocField(source), oop
end
- local parent = source.parent
- if parent then
- return buildName(parent, oop)
+ if source.type == 'method'
+ or source.type == 'field'
+ or source.type == 'function' then
+ return buildName(source.parent, oop)
end
return nil, oop
end