Repository: godotengine/godot (language: cpp)

Issue:
C# inspector warning grows after second change
### Tested versions

4.4

### System information

W10

### Issue description

When you modify a C# script while its node is inspected, you will get `This inspector might be out of date.` warning. If you change the script again, the warning panel grows.

https://github.com/user-attachments/assets/a0d47023-2440-46d3-aab7-0806f1ee1559

Further changes don't make it bigger.

### Steps to reproduce

1. Attach a C# script to a node
2. Open the script, modify and save it
3. The inspector should show a warning
4. Repeat

### Minimal reproduction project (MRP)

N/A


Discussion / hints:
I'm able to reproduce in `4.4-stable` but not in `4.3-stable`. The code for this Control ([InspectorOutOfSyncWarning.cs](https://github.com/godotengine/godot/blob/49cc57a75dfd262bd49698910595becf3aae597b/modules/mono/editor/GodotTools/GodotTools/Inspector/InspectorOutOfSyncWarning.cs)) hasn't changed at all between those 2 versions. Maybe something changed in [editor_inspector.cpp](https://github.com/godotengine/godot/blob/49cc57a75dfd262bd49698910595becf3aae597b/editor/editor_inspector.cpp)?

I've bisected it to d678b095f9998a9a6fb785de3e712ec7605726a4.
CC @YeldhamDev 
Could you be more descriptive? I'm unable to reproduce this on my end.
Open the script in the Godot's script editor and use File -> Save option after modifying the script in any way.
In my video the inspector changes after I save the script (with script editor's save option, not save scene).
I'm sorry, but still nothing:

https://github.com/user-attachments/assets/3cfcdad3-7d3a-4f65-8cf4-b0c7c9ad0274
Try building the project to get rid of the text, and then modify/save the script multiple times. It might not happen on the first try.
I was just able to reproduce it in a fresh project with all default settings. Although I only tested 4.4 stable, not master.
Alright, _now_ it happened on my end. Will investigate the cause.
This is so odd. From what I'm testing here, it seems that the problem is in the warning's `Label` itself. If for example, I enable `clip_text` and set a custom minimum height, it doesn't happen anymore...

Fix patch:
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 46d787762d31..8ad90dd0a2e4 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -3152,13 +3152,14 @@ void EditorInspector::update_tree() {
 	Color sscolor = get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor));
 	bool sub_inspectors_enabled = EDITOR_GET("interface/inspector/open_resources_in_current_inspector");
 
-	// Get the lists of editors to add the beginning.
-	for (Ref<EditorInspectorPlugin> &ped : valid_plugins) {
-		ped->parse_begin(object);
-		_parse_added_editors(begin_vbox, nullptr, ped);
-	}
-	if (begin_vbox->get_child_count()) {
+	if (!valid_plugins.is_empty()) {
 		begin_vbox->show();
+
+		// Get the lists of editors to add the beginning.
+		for (Ref<EditorInspectorPlugin> &ped : valid_plugins) {
+			ped->parse_begin(object);
+			_parse_added_editors(begin_vbox, nullptr, ped);
+		}
 	}
 
 	StringName doc_name;


Test patch: