How to debug EditorScript/EditorPlugin?

Godot Version

3.5.3 and 4.2.1

Question

I’m trying to develop a script to help import create lines and paths. I tried both an EditorScript that I just run using the Run menu or using an entry in the menu using add_tool_menu_item. Either way, I am having some issues and when I tried setting breakpoints by clicking on the side and adding little red dots, but when I run it, the script runs, I see the print statements printed but the debugger doesn’t pop up. Tried both in Godot 3 and 4.
Is there any special way to invoke an editor script so that I can debug it step-by-step?

Print statements is really the best and only way. It’s actually not so terrible.

It is kinda terrible. I’m trying to parse some external files and when using print statements Godot complained about printing too much.

1 Like

Yes, its a limitation, but if you have that kind of issue, then create a function that prints only a few statements. There are workarounds depending what you want to do.

E,g, a count variable

var count=3
func _process(delta):
	if count != 0:
		print(delta, "something whatever")
		count-=1