summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeOzay <colpaert.benoit@gmail.com>2024-07-13 16:42:33 +0200
committerNeOzay <colpaert.benoit@gmail.com>2024-07-13 16:42:33 +0200
commit828d0a5c4a4acdad8397d6b7576b45947484ceb7 (patch)
treea496487584e170807a09687a72fe4d292fa2cb3e
parent46707395df3255808682fdac883f7d86c1ac9a78 (diff)
downloadlua-language-server-828d0a5c4a4acdad8397d6b7576b45947484ceb7.zip
fix a specific case for getVisibleType
-rw-r--r--script/vm/visible.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/script/vm/visible.lua b/script/vm/visible.lua
index 0f486d6b..fddb7faf 100644
--- a/script/vm/visible.lua
+++ b/script/vm/visible.lua
@@ -96,10 +96,14 @@ function vm.getParentClass(source)
if source.type == 'setfield'
or source.type == 'setindex'
or source.type == 'setmethod'
- or source.type == 'tablefield'
or source.type == 'tableindex' then
return vm.getDefinedClass(guide.getUri(source), source.node)
end
+
+ if source.type == 'tablefield' then
+ return vm.getDefinedClass(guide.getUri(source), source.node) or
+ vm.getDefinedClass(guide.getUri(source), source.parent.parent)
+ end
return nil
end