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 | |
parent | e4e5edbb3a9a53a7dffb4ab22ff8f6a0f69ce35b (diff) | |
download | lua-language-server-be19b8b2e6246bd53e08df3fabaa8442b3422dc6.zip |
fix endless loop
-rw-r--r-- | .vscode/launch.json | 2 | ||||
-rw-r--r-- | script/core/hover/name.lua | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json index 802eba16..c2dd4704 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -24,7 +24,7 @@ "type": "lua", "request": "attach", "stopOnEntry": true, - "address": "127.0.0.1:11427", + "address": "127.0.0.1:11413", "outputCapture": [ ], "sourceMaps": [ 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 |