Open AlexDarigan opened 5 years ago
3.1
The source_code property of scripts has been very helpful in parsing GDScripts dynamically for plugins. However when it comes to inner classes, the source_code will always return empty.
extends Node class Example: func greet(): print("Hello World") func _ready(): print(Example.source_code.empty())
Outputs true
Returning source_code for inner classes would be a huge benefit for more complex tool-making. It could also have the extra benefit of
var source = Inner.get_base_script().source_code
making more sense if dealing with non-inner class parents.
I can reproduce this on 3.2.2 and https://github.com/godotengine/godot/commit/f97280a0127950f5ae7d2e38f239ab9633afb041.
3.1
The source_code property of scripts has been very helpful in parsing GDScripts dynamically for plugins. However when it comes to inner classes, the source_code will always return empty.
Outputs true
Returning source_code for inner classes would be a huge benefit for more complex tool-making. It could also have the extra benefit of
var source = Inner.get_base_script().source_code
making more sense if dealing with non-inner class parents.