Maran23/script-ide

BUG: Recognizes inner class as a const and therefore causing error

Closed this issue · 1 comments

Hi there, thanks for the helpful plugin! I hope to report this bug:

When you have an inner class in the script, defined with class keyword, inheriting from any class other than RefCounted, it will be recognized as a constant rather than a class.

For example, even if you have class Inner extends Resource (which is a subclass of RefCounted) it will still trigger this bug. But as long as the inner class inherits from RefCounted, no matter implicitly (which is the default case when you don't write the extends keyword) or explicitly by class Inner extends RefCounted, it will be correctly identified as a class.

The wrongly classified ones will show in the side pane along with a red empty circle icon, instead of the red square for classes. And if you click on them, the console will have the following error output:

core/variant/variant_utility.cpp:1091 - const Inner or enum not found in source code

Thanks for the report! This is unfortunately due to Godot handling constants and inner classes somewhat similar. I'm currently checking if it is possible for us to find out what the type exactly is.