| 197 | } |
| 198 | |
| 199 | void 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 | |
| 218 | void TextEditor::_update_bookmark_list() { |
| 219 | bookmarks_menu->clear(); |
nothing calls this directly
no test coverage detected