4.6b1 Can’t find anything.
What do you mean? Scripts are automatically re-parsed by default whenever you change something.
Only the script that was changed outputs erros into log on my end.
If the error affects several classes, like renamed method in super, i don’t know how to trigger full reparsing of everything. This is also an issue if i clear the log, no quick way to get errors outputed apart from resaving a single file.
If you save everything, everything will be re-parsed.
You can also try reloading the whole project. This helps with resetting some references after fixing class errors.
I tried but its a bit extreme to lose state and wait several seconds which will probably linearly grow with project complexity just for this.
Unfortunately i can’t make vscode save all if the files weren’t modified, and i don’t see an option to do that in godot.
How often does it happen that losing several seconds is a problem to you?
Even mid-size projects don’t really take more than a couple seconds to load for me.
It’s good to know that the time will be constant, but i still think its less acceptable and last resort way to do this. I am looking into editor scripting to append \n at the end of all scripts or remove it if its present, that should trigger full reparsing safely. Do you think its possible do to with GDScript?
What exactly are you trying to pull off here? Describe what are you trying to make. Otherwise it looks like we’ll be entering xy problem territory.
Made a little tool that flags files as modified without changing them, potentially dangerous, dont use without version control. Called from command panel Resave All Scripts. Needs atl-tabbing for godot to pickup changes.
UPD: Added automatic Output log clearing, and rescanning of the assets. No need to alt-tab now.
@tool
extends EditorScript
class_name ResaveAllScripts
var mask: Array[String] = ["_src"]
func _run() -> void:
pressClearButton()
for path in mask:
reparse("res://%s/" % path)
EditorInterface.get_resource_filesystem().scan()
func reparse(path: String) -> void:
var dirs:= DirAccess.get_directories_at(path)
var files:= DirAccess.get_files_at(path)
for dirname in dirs:
reparse(path + "/" + dirname)
for filename in files:
reparse_single_file(path + "/" + filename)
func reparse_single_file(path: String) -> void:
if path.get_extension() == "gd":
var stream := FileAccess.open(path, FileAccess.READ_WRITE)
if stream:
if stream.get_length() <= 8: return
var bytes:= stream.get_64()
stream.seek(0)
stream.store_64(bytes)
stream = null
func pressClearButton()->void:
var shortcut:= EditorInterface.get_editor_settings().get_shortcut("editor/clear_output").get_as_text()
var root:=EditorInterface.get_inspector().get_tree().root
_pressClearButton(root, shortcut)
func _pressClearButton(node:Node, shortcutText:String)->bool:
for i in node.get_child_count():
var child:= node.get_child(i)
if child is Button:
var b:= child as Button
if b.shortcut:
if b.shortcut.get_as_text() == shortcutText:
b.pressed.emit()
return true
if child.get_child_count() > 0:
if _pressClearButton(child, shortcutText):
return true
return false