MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _validate_script

Method _validate_script

editor/script/text_editor.cpp:199–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void TextEditor::_validate_script() {
200 emit_signal(SNAME("name_changed"));
201 emit_signal(SNAME("edited_script_changed"));
202
203 Ref<JSON> json_file = edited_res;
204 if (json_file.is_valid()) {
205 CodeEdit *te = code_editor->get_text_editor();
206
207 te->set_line_background_color(code_editor->get_error_pos().x, Color(0, 0, 0, 0));
208 code_editor->set_error("");
209
210 if (json_file->parse(te->get_text(), true) != OK) {
211 code_editor->set_error(json_file->get_error_message().replace("[", "[lb]"));
212 code_editor->set_error_pos(json_file->get_error_line(), 0);
213 te->set_line_background_color(code_editor->get_error_pos().x, EDITOR_GET("text_editor/theme/highlighting/mark_color"));
214 }
215 }
216}
217
218void TextEditor::_update_bookmark_list() {
219 bookmarks_menu->clear();

Callers

nothing calls this directly

Calls 12

get_text_editorMethod · 0.80
get_error_posMethod · 0.80
get_error_messageMethod · 0.80
set_error_posMethod · 0.80
ColorClass · 0.50
is_validMethod · 0.45
set_errorMethod · 0.45
parseMethod · 0.45
get_textMethod · 0.45
replaceMethod · 0.45
get_error_lineMethod · 0.45

Tested by

no test coverage detected