-
-
Notifications
You must be signed in to change notification settings - Fork 24k
Expose the EditorScriptHighlighter::_create() method to GDExtension
#98929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose the EditorScriptHighlighter::_create() method to GDExtension
#98929
Conversation
|
Would like to see this added soon. |
|
@MXKhronos Do you have a project to test this with? I don't really know these APIs nor have anything setup to test it, which is why this is still marked as a draft |
Yeah, I'm working & learning to add Luau to Godot via a gdextension mimicking the godot/modules/gdscript approach but I have not yet figured out how to get godot-cpp bindings from my custom godot build with this pull's commits. https://github.com/MXKhronos/LuauGDExtension It's in My build gets the same issue as the issue in the post. |
@MXKhronos Have you tested if this PR helps to fix the issue for you? |
Sorry, I'm new to this. How do I generate cpp bindings from my custom godot build to test it? I've tried adding I ran |
|
You need to first build Godot with this PR, and then you can run |
|
Thanks! It compile, runs and seems fix, that's all my extension does atm. Ref<EditorSyntaxHighlighter> EditorSyntaxHighlighter::_create() const {
Ref<EditorSyntaxHighlighter> syntax_highlighter;
if (GDVIRTUAL_IS_OVERRIDDEN(_create)) {
print_verbose("Using overridden syntax highlighter");
GDVIRTUAL_CALL(_create, syntax_highlighter);
} else {
print_verbose("Using default syntax highlighter");
syntax_highlighter.instantiate();
if (get_script_instance()) {
syntax_highlighter->set_script(get_script_instance()->get_script());
}
}
return syntax_highlighter;
} |
|
Thanks for testing! I'll take this out of DRAFT then :-) |
EditorScriptHighlighter::_create() method to GDExtensionEditorScriptHighlighter::_create() method to GDExtension
|
Thanks! |

Possibly fixes godotengine/godot-cpp#1636
I don't personally know this API, so I don't know if this is the right fix, but throwing this up here either as the fix (if the folks who know this API think this is the right way to do it), or as an example for someone else to take over.