diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-03 14:46:44 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-03 14:46:44 +0200 |
commit | 8b6c867c81f171f24d3daca5d6eb9d07fbd09f27 (patch) | |
tree | e835255864a86107bbef44d4f1ba5869b4fa5c89 /editor/debugger/script_editor_debugger.cpp | |
parent | ae8f1015e0ce7c55bf795c4c70c8369a76303588 (diff) | |
parent | 13ab2b6f4f61dbfb4f90c6602f126c247d4c38c5 (diff) | |
download | redot-engine-8b6c867c81f171f24d3daca5d6eb9d07fbd09f27.tar.gz |
Merge pull request #79280 from raulsntos/dotnet/better-push-error
C#: Improve `GD.PushError` and `GD.PushWarning`
Diffstat (limited to 'editor/debugger/script_editor_debugger.cpp')
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 2c40f0e120..afa6aaf395 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -569,8 +569,11 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread error->set_custom_color(1, color); String error_title; - if (oe.callstack.size() > 0) { - // If available, use the script's stack in the error title. + if (!oe.source_func.is_empty() && source_is_project_file) { + // If source function is inside the project file. + error_title += oe.source_func + ": "; + } else if (oe.callstack.size() > 0) { + // Otherwise, if available, use the script's stack in the error title. error_title = _format_frame_text(&oe.callstack[0]) + ": "; } else if (!oe.source_func.is_empty()) { // Otherwise try to use the C++ source function. @@ -645,7 +648,10 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread if (i == 0) { stack_trace->set_text(0, "<" + TTR("Stack Trace") + ">"); stack_trace->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); - error->set_metadata(0, meta); + if (!source_is_project_file) { + // Only override metadata if the source is not inside the project. + error->set_metadata(0, meta); + } tooltip += TTR("Stack Trace:") + "\n"; } |