|Topic was automatically imported from the old Question2Answer platform.
I’m trying to create a code-generation editor plugin, somewhat similar in nature to what “connect signal” dialog does, when it appends a connected method to the script.
I’m at a point, where I have a
Script object, and can actually modify its source code. But my changes aren’t immediately visible in the Godot script editor. So far I’ve tried changing the
Script.source_code property; calling
emit_changed() on a
Script after I perform my modifications; using
File and re-writing the source code on the filesystem; calling
EditorInterface; and various combinations of all of these.
No matter what I do, my changes to the script sourcecode become visible only if I either close the script in the editor and reopen it from the scene explorer, or if I alt-tab to a different window and then back to Godot again.
How can I achieve behavior similar to what “Connect a Signal to a Method” dialog does?