diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-15 17:01:18 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-15 17:01:18 +0800 |
commit | be19b8b2e6246bd53e08df3fabaa8442b3422dc6 (patch) | |
tree | 872596a8b604029b724a336078595c6f57321668 /script | |
parent | e4e5edbb3a9a53a7dffb4ab22ff8f6a0f69ce35b (diff) | |
download | lua-language-server-be19b8b2e6246bd53e08df3fabaa8442b3422dc6.zip |
fix endless loop
Diffstat (limited to 'script')
-rw-r--r-- | script/core/hover/name.lua | 7 |
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 |