diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-05 09:05:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 09:05:56 +0100 |
commit | 6d4ed65f4cba81a1f6c9bec1e8a0d2f543faaeab (patch) | |
tree | fd85df7986fcf273c82194311d66ddf6110fef81 /editor/plugins/script_text_editor.cpp | |
parent | b57b2447be2c01516342ae72a77efb012f96f021 (diff) | |
parent | 923b7b27486212786364327235dfe8bead629a5d (diff) |
Merge pull request #56483 from vnen/gdscript-warning-annotation
Add annotation to ignore warnings
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index ab5c9a0ef1..97a882c383 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -238,10 +238,6 @@ void ScriptTextEditor::_show_warnings_panel(bool p_show) { void ScriptTextEditor::_warning_clicked(Variant p_line) { if (p_line.get_type() == Variant::INT) { goto_line_centered(p_line.operator int64_t()); - } else if (p_line.get_type() == Variant::DICTIONARY) { - Dictionary meta = p_line.operator Dictionary(); - code_editor->get_text_editor()->insert_line_at(meta["line"].operator int64_t() - 1, "# warning-ignore:" + meta["code"].operator String()); - _validate_script(); } } @@ -468,20 +464,8 @@ void ScriptTextEditor::_validate_script() { } // Add script warnings. - warnings_panel->push_table(3); + warnings_panel->push_table(2); for (const ScriptLanguage::Warning &w : warnings) { - Dictionary ignore_meta; - ignore_meta["line"] = w.start_line; - ignore_meta["code"] = w.string_code.to_lower(); - warnings_panel->push_cell(); - warnings_panel->push_meta(ignore_meta); - warnings_panel->push_color( - warnings_panel->get_theme_color(SNAME("accent_color"), SNAME("Editor")).lerp(warnings_panel->get_theme_color(SNAME("mono_color"), SNAME("Editor")), 0.5)); - warnings_panel->add_text(TTR("[Ignore]")); - warnings_panel->pop(); // Color. - warnings_panel->pop(); // Meta ignore. - warnings_panel->pop(); // Cell. - warnings_panel->push_cell(); warnings_panel->push_meta(w.start_line - 1); warnings_panel->push_color(warnings_panel->get_theme_color(SNAME("warning_color"), SNAME("Editor"))); |