Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Editor: Fix autocomplete icon for CODE_COMPLETION_KIND_CLASS

VewDev3001c50acd55
diff --git a/editor/gui/code_editor.cpp b/editor/gui/code_editor.cpp
index 05307e17fc6..35e56fd4071 100644
--- a/editor/gui/code_editor.cpp
+++ b/editor/gui/code_editor.cpp
@@ -1061,10 +1061,11 @@ Ref<Texture2D> CodeTextEditor::_get_completion_icon(const ScriptLanguage::CodeCo
Ref<Texture2D> tex;
switch (p_option.kind) {
case ScriptLanguage::CODE_COMPLETION_KIND_CLASS: {
- if (has_theme_icon(p_option.display, EditorStringName(EditorIcons))) {
- tex = get_editor_theme_icon(p_option.display);
+ const String formatted_class_name = p_option.display.unquote();
+ if (has_theme_icon(formatted_class_name, EditorStringName(EditorIcons))) {
+ tex = get_editor_theme_icon(formatted_class_name);
} else {
- tex = EditorNode::get_singleton()->get_class_icon(p_option.display);
+ tex = EditorNode::get_singleton()->get_class_icon(formatted_class_name);
if (tex.is_null()) {
tex = get_editor_theme_icon(SNAME("Object"));
}