Merge pull request #27170 from timoschwarzer/allow-whitespaces-in-warning-ignore-comments
Allow whitespaces in warning-ignore comments
This commit is contained in:
commit
07b76c0376
@ -286,7 +286,7 @@ void ScriptTextEditor::_warning_clicked(Variant p_line) {
|
|||||||
code_editor->get_text_edit()->cursor_set_line(p_line.operator int64_t());
|
code_editor->get_text_edit()->cursor_set_line(p_line.operator int64_t());
|
||||||
} else if (p_line.get_type() == Variant::DICTIONARY) {
|
} else if (p_line.get_type() == Variant::DICTIONARY) {
|
||||||
Dictionary meta = p_line.operator Dictionary();
|
Dictionary meta = p_line.operator Dictionary();
|
||||||
code_editor->get_text_edit()->insert_at("#warning-ignore:" + meta["code"].operator String(), meta["line"].operator int64_t() - 1);
|
code_editor->get_text_edit()->insert_at("# warning-ignore:" + meta["code"].operator String(), meta["line"].operator int64_t() - 1);
|
||||||
_validate_script();
|
_validate_script();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -535,13 +535,14 @@ void GDScriptTokenizerText::_advance() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
if (comment.begins_with("#warning-ignore:")) {
|
String comment_content = comment.trim_prefix("#").trim_prefix(" ");
|
||||||
String code = comment.get_slice(":", 1);
|
if (comment_content.begins_with("warning-ignore:")) {
|
||||||
|
String code = comment_content.get_slice(":", 1);
|
||||||
warning_skips.push_back(Pair<int, String>(line, code.strip_edges().to_lower()));
|
warning_skips.push_back(Pair<int, String>(line, code.strip_edges().to_lower()));
|
||||||
} else if (comment.begins_with("#warning-ignore-all:")) {
|
} else if (comment_content.begins_with("warning-ignore-all:")) {
|
||||||
String code = comment.get_slice(":", 1);
|
String code = comment_content.get_slice(":", 1);
|
||||||
warning_global_skips.insert(code.strip_edges().to_lower());
|
warning_global_skips.insert(code.strip_edges().to_lower());
|
||||||
} else if (comment.strip_edges() == "#warnings-disable") {
|
} else if (comment_content.strip_edges() == "warnings-disable") {
|
||||||
ignore_warnings = true;
|
ignore_warnings = true;
|
||||||
}
|
}
|
||||||
#endif // DEBUG_ENABLED
|
#endif // DEBUG_ENABLED
|
||||||
|
Loading…
Reference in New Issue
Block a user