Skip to content

Commit 9712d6f

Browse files
committed
Merge pull request godotengine#109549 from jroprohehe/unknown_error_getting_token_fix
Fix the text editor confusing resource files of class JSON with json files.
2 parents f745685 + e4763e6 commit 9712d6f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

editor/script/script_editor_plugin.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4648,7 +4648,11 @@ bool ScriptEditorPlugin::handles(Object *p_object) const {
46484648
}
46494649

46504650
if (Object::cast_to<JSON>(p_object)) {
4651-
return true;
4651+
// This is here to stop resource files of class JSON from getting confused
4652+
// with json files and being opened in the text editor.
4653+
if (Object::cast_to<JSON>(p_object)->get_path().get_extension().to_lower() == "json") {
4654+
return true;
4655+
}
46524656
}
46534657

46544658
return p_object->is_class("Script");

0 commit comments

Comments
 (0)