summaryrefslogtreecommitdiffstats
path: root/editor/debugger/script_editor_debugger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/debugger/script_editor_debugger.cpp')
-rw-r--r--editor/debugger/script_editor_debugger.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 8985387043..2e41cd709d 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -526,8 +526,11 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
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.
@@ -602,7 +605,10 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
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";
}