diff --git a/editor/script/script_editor_plugin.cpp b/editor/script/script_editor_plugin.cpp index 96c7720d7ca..5f8a26ecc65 100644 --- a/editor/script/script_editor_plugin.cpp +++ b/editor/script/script_editor_plugin.cpp @@ -4648,7 +4648,11 @@ bool ScriptEditorPlugin::handles(Object *p_object) const { } if (Object::cast_to(p_object)) { - return true; + // This is here to stop resource files of class JSON from getting confused + // with json files and being opened in the text editor. + if (Object::cast_to(p_object)->get_path().get_extension().to_lower() == "json") { + return true; + } } return p_object->is_class("Script");