| 3993 | } |
| 3994 | |
| 3995 | void ScriptEditor::_open_script_request(const String &p_path) { |
| 3996 | Ref<Script> scr = ResourceLoader::load(p_path); |
| 3997 | if (scr.is_valid()) { |
| 3998 | script_editor->edit(scr, false); |
| 3999 | return; |
| 4000 | } |
| 4001 | |
| 4002 | Ref<JSON> json = ResourceLoader::load(p_path); |
| 4003 | if (json.is_valid()) { |
| 4004 | script_editor->edit(json, false); |
| 4005 | return; |
| 4006 | } |
| 4007 | |
| 4008 | Error err; |
| 4009 | Ref<TextFile> text_file = script_editor->_load_text_file(p_path, &err); |
| 4010 | if (text_file.is_valid()) { |
| 4011 | script_editor->edit(text_file, false); |
| 4012 | return; |
| 4013 | } |
| 4014 | } |
| 4015 | |
| 4016 | void ScriptEditor::register_syntax_highlighter(const Ref<EditorSyntaxHighlighter> &p_syntax_highlighter) { |
| 4017 | ERR_FAIL_COND(p_syntax_highlighter.is_null()); |
nothing calls this directly
no test coverage detected