diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index bf2b4f98fc3..d072df0c3bd 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -3088,6 +3088,12 @@ void openTextEditor(const QString &titlePattern0, const QString &contents) IEditor *editor = EditorManager::openEditorWithContents( CC::K_DEFAULT_TEXT_EDITOR_ID, &titlePattern, contents.toUtf8(), QString(), EditorManager::IgnoreNavigationHistory); + if (auto textEditor = qobject_cast(editor)) { + QString suggestion = titlePattern; + if (!suggestion.contains(QLatin1Char('.'))) + suggestion.append(QLatin1String(".txt")); + textEditor->textDocument()->setSuggestedFileName(suggestion); + } QTC_ASSERT(editor, return); }