Any plans for 4.4 support?
Hi, I just found this plugin and I must say you're doing god's work. I was wondering if you have plans to update it to 4.4, and whether you have considered adding any of the following features:
- Support for more complex macros
- Support for preprocessing before running in the editor (I guess this one is especially tricky because you don't want to modify people's code in place, so I guess you would have to intervene the script loading process somehow)
Thank you for your interest and questions!
This plugin probably already supports 4.4, but I need to make sure.
As for features, I was thinking about the following:
- Remove some current limitations. Add support for built-in scripts, lambda functions, one-line conditions.
- Add directives for inlining functions. This does not provide as powerful capabilities as macros in C/C++, but can be used for optimizations that are currently missing in GDScript.
- Maybe I could implement some optimizations within this plugin, such as Dead Code Elimination.
However, implementing most of the features listed above requires rewriting my GDScript "parser", which is currently extremely efficient, but quite difficult to maintain and modify.
As for preprocessor support in the editor, I doubt that this is easily achievable. The main idea of this plugin is to use EditorExportPlugin, which is not applicable to the editor. GDScript has no mechanism to interfere with its pipeline at this level.
In theory, it could be done with a custom ResourceFormatLoader, but I doubt it would work seamlessly enough, perform well enough, and be compatible with Godot's built-in functionality (script editor, autocompletion, etc.). It would also probably require a lot more work to achieve.
If we want a GDScript preprocessor that works correctly in the editor, I think it would be best to implement it in the GDScript module itself. There have been several attempts to do this, but they have not received a clear response:
- godotengine/godot#80619
- godotengine/godot#102083
Thank you so much for your quick response. Seems like a reasonable roadmap. And what you said about the editor makes perfect sense. I've got most of my team sold on using this addon, so I'll be sure to provide feedback and/or report any bugs we find when we do.