| 196 | |
| 197 | #ifdef DEBUG_ENABLED |
| 198 | void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_code, const Vector<String> &p_symbols) { |
| 199 | ERR_FAIL_NULL(p_source); |
| 200 | ERR_FAIL_INDEX(p_code, GDScriptWarning::WARNING_MAX); |
| 201 | |
| 202 | if (is_ignoring_warnings) { |
| 203 | return; |
| 204 | } |
| 205 | if (GLOBAL_GET_CACHED(bool, "debug/gdscript/warnings/exclude_addons") && script_path.begins_with("res://addons/")) { |
| 206 | return; |
| 207 | } |
| 208 | GDScriptWarning::WarnLevel warn_level = (GDScriptWarning::WarnLevel)(int)GLOBAL_GET(GDScriptWarning::get_settings_path_from_code(p_code)); |
| 209 | if (warn_level == GDScriptWarning::IGNORE) { |
| 210 | return; |
| 211 | } |
| 212 | |
| 213 | PendingWarning pw; |
| 214 | pw.source = p_source; |
| 215 | pw.code = p_code; |
| 216 | pw.treated_as_error = warn_level == GDScriptWarning::ERROR; |
| 217 | pw.symbols = p_symbols; |
| 218 | |
| 219 | pending_warnings.push_back(pw); |
| 220 | } |
| 221 | |
| 222 | void GDScriptParser::apply_pending_warnings() { |
| 223 | for (const PendingWarning &pw : pending_warnings) { |
no test coverage detected