From 462079f8067d4559881d393c57bdd794f05be237 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 22 Nov 2023 14:12:18 +0100 Subject: [PATCH 1/8] CppEditor: Fix renaming virtual functions Before renaming, we first follow the symbol to see whether it originates from a generated files. We must not try to list the overrides for virtual member functions in that context. Amends 06390f5b5342b32825e1cf2c90e10a6082d58867. Change-Id: Ic17e865a03b884d63875622f54448fef63c24b7e Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: Christian Stenger --- src/plugins/cppeditor/cppeditorwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 0419ef6b035..8f06a363ea8 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -625,7 +625,7 @@ void CppEditorWidget::renameUsages(const QString &replacement, QTextCursor curso }; CppModelManager::followSymbol( CursorInEditor{cursor, textDocument()->filePath(), this, textDocument()}, - continuation, true, false); + continuation, false, false); } void CppEditorWidget::renameUsages(const Utils::FilePath &filePath, const QString &replacement, From 78329318f3ecc425683294c6c7d72a62a4c8d1d4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 24 Nov 2023 11:11:00 +0100 Subject: [PATCH 2/8] Update qbs submodule to HEAD of 2.2 branch Change-Id: I9a816a352917fd411b0fc07d4090be195790b06f Reviewed-by: Christian Stenger --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 5ef68807776..7867c6aaa37 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 5ef68807776960c90d0572d51af36fc536bbe30e +Subproject commit 7867c6aaa375e6c7ff3affb67dc6af56df1ecdf4 From e2c1d12a05d7726ed32056584b22c5b10df6613e Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 24 Nov 2023 12:55:05 +0100 Subject: [PATCH 3/8] CppEditor: Fix "SelectBlockUp" for string literals Literal::size() is the number of chars used internally, not necessarily the number of logical characters. Fixes: QTCREATORBUG-29844 Change-Id: I74431a2f3f533482567c3774f09deb44dc83d9f0 Reviewed-by: David Schulz --- src/plugins/cppeditor/cppselectionchanger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppselectionchanger.cpp b/src/plugins/cppeditor/cppselectionchanger.cpp index 7b9f6767451..3d31893311b 100644 --- a/src/plugins/cppeditor/cppselectionchanger.cpp +++ b/src/plugins/cppeditor/cppselectionchanger.cpp @@ -546,7 +546,7 @@ void CppSelectionChanger::fineTuneASTNodePositions(ASTNodePositions &positions) // Start position will be the end position minus the size of the actual contents of the // literal. - int newPosStart = newPosEnd - firstToken.string->size(); + int newPosStart = newPosEnd - QString::fromUtf8(firstToken.string->chars()).size(); // Skip raw literal parentheses. if (isRawLiteral) From badc0b4ea539ede9959f711005a9497747e972a3 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 24 Nov 2023 13:18:20 +0100 Subject: [PATCH 4/8] CPlusPlus: Fix parser crash The parseCompoundStatement() function can return without setting the output parameter if the maximum statement depth is exceeded. Task-number: QTCREATORBUG-29847 Change-Id: Ifd76cd948c30498863246a1b80bd0657950101ca Reviewed-by: Christian Stenger --- src/libs/3rdparty/cplusplus/Parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp index 395556777dd..30e3fe0be1b 100644 --- a/src/libs/3rdparty/cplusplus/Parser.cpp +++ b/src/libs/3rdparty/cplusplus/Parser.cpp @@ -4946,8 +4946,8 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node) CompoundExpressionAST *ast = new (_pool) CompoundExpressionAST; ast->lparen_token = consumeToken(); StatementAST *statement = nullptr; - parseCompoundStatement(statement); - ast->statement = statement->asCompoundStatement(); + if (parseCompoundStatement(statement)) + ast->statement = statement->asCompoundStatement(); match(T_RPAREN, &ast->rparen_token); node = ast; return true; From 39b09890504517c6a2029f64379b667ce148b390 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 23 Nov 2023 09:30:28 +0100 Subject: [PATCH 5/8] Sqlite: Fix missing include file in dev package sqliteexception.h:6:10: fatal error: sqlite3_fwd.h: No such file or directory Amends eed303450d96471f258254d71eee070f2c8caf4b Change-Id: I350246e223bd80129b1fb29e8b2b57953536b5c7 Reviewed-by: Reviewed-by: Cristian Adam --- src/libs/sqlite/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/sqlite/CMakeLists.txt b/src/libs/sqlite/CMakeLists.txt index aa33171bab1..b54da930ae2 100644 --- a/src/libs/sqlite/CMakeLists.txt +++ b/src/libs/sqlite/CMakeLists.txt @@ -37,6 +37,7 @@ add_qtc_library(Sqlite constraints.h createtablesqlstatementbuilder.h lastchangedrowid.h + sqlite3_fwd.h sqlitealgorithms.h sqlitebasestatement.cpp sqlitebasestatement.h sqlitecolumn.h From c3907bf781e43dabff7ef09c847a35bad97f8698 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 27 Nov 2023 09:50:37 +0100 Subject: [PATCH 6/8] Bump version to 12.0.1 Change-Id: Iac214602e3bfef975c8e4083ba251a652ed1ebc7 Reviewed-by: David Schulz --- cmake/QtCreatorIDEBranding.cmake | 4 ++-- qbs/modules/qtc/qtc.qbs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index 6165cd3688b..33abd0e3f56 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "12.0.0") # The IDE version. +set(IDE_VERSION "12.0.1") # The IDE version. set(IDE_VERSION_COMPAT "12.0.0") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "12.0.0") # The IDE display version. +set(IDE_VERSION_DISPLAY "12.0.1") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 79d0b0d5cf2..6007489259e 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,10 +4,10 @@ import qbs.FileInfo import qbs.Utilities Module { - property string qtcreator_display_version: '12.0.0' + property string qtcreator_display_version: '12.0.1' property string ide_version_major: '12' property string ide_version_minor: '0' - property string ide_version_release: '0' + property string ide_version_release: '1' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release From 61e9a7fe164ebdf8ce32df8cb260a8392d90170e Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 24 Nov 2023 14:22:59 +0100 Subject: [PATCH 7/8] CppEditor: Fix comment conversion for indented comments Due to accidentally overlapping removal/replace operations, it could happen that we lost actual content when trying to remove whitespace. Amends f93836b25d57fed5888b1376e1e1b2d084fcb98d. Change-Id: I7a624e78cf0986ee9818d47ea0812c6632426a24 Reviewed-by: David Schulz Reviewed-by: Qt CI Bot Reviewed-by: --- src/plugins/cppeditor/cppquickfix_test.cpp | 17 +++++++++++++++++ src/plugins/cppeditor/cppquickfixes.cpp | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index d2cf58ebfb4..b42000a0e1c 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -9115,6 +9115,23 @@ int var2;)"; // A third affected comment /* An unaffected comment */)"; + // FIXME: Remove adjacent newline along with last block + // FIXME: Use CppRefactoringFile to auto-indent continuation lines? + QTest::newRow("C -> C++, indented") << R"( +struct S { + /* + * @This is an + * indented comment. + */ + void func(); +)" << R"( +struct S { + // This is an +// indented comment. + + void func(); +)"; + QTest::newRow("C++ -> C / no selection / single line") << R"( // Other comment, unaffected // Our @comment diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 7c460a0ad73..37a56363401 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -9438,6 +9438,7 @@ private: changeSet.remove(block.position() + firstColumn, block.position() + endColumn); }; const int contentIndex = indexOfActualContent(); + int removed = 0; if (contentIndex == -1) { if (blockIsRemovable) { removeBlock(); @@ -9455,6 +9456,7 @@ private: } else { changeSet.remove(block.position() + firstColumn, block.position() + firstColumn + contentIndex); + removed = contentIndex; } if (block == firstBlock) { @@ -9464,7 +9466,7 @@ private: // If the line starts with enough whitespace, replace it with the // comment start characters, so we don't move the content to the right // unnecessarily. Otherwise, insert the comment start characters. - if (blockText.startsWith(QString(newCommentStart.size() + 1, ' '))) { + if (blockText.startsWith(QString(newCommentStart.size() + removed + 1, ' '))) { changeSet.replace(block.position(), block.position() + newCommentStart.length(), newCommentStart); From d7545f9bf5dc6fe77dc3f4b284880467c4e2087c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 21 Nov 2023 14:59:32 +0100 Subject: [PATCH 8/8] Prevent lldb from enabling os_log mirroring to stderr lldb will normally set OS_ACTIVITY_DT_MODE, so that NSLog is mirrored to stderr, but this also affects os_log, which we use in the Apple unified logging backend. When we detect this situation in the unified logging backend, we disable Qt's own stderr logging, to avoid duplicate messages. As the Qt stderr logging is preferable to the stderr logging that os_log gives, we override lldb's choice, using the same environment variable opt out that Xcode uses: IDE_DISABLED_OS_ACTIVITY_DT_MODE. This makes console output in Qt Creator the same, regardless of whether the user is debugging the app or not. Change-Id: I5544bde803671258cede918705388c9283885e30 Reviewed-by: Axel Spoerl Reviewed-by: Timur Pocheptsov Reviewed-by: Eike Ziller --- src/plugins/debugger/lldb/lldbengine.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 12da7a86fc4..f3afd26b43d 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -266,7 +266,13 @@ void LldbEngine::handleLldbStarted() cmd2.arg("startmode", rp.startMode); cmd2.arg("nativemixed", isNativeMixedActive()); cmd2.arg("workingdirectory", rp.inferior.workingDirectory.path()); - cmd2.arg("environment", rp.inferior.environment.toStringList()); + QStringList environment = rp.inferior.environment.toStringList(); + // Prevent lldb from automatically setting OS_ACTIVITY_DT_MODE to mirror + // NSLog to stderr, as that will also mirror os_log, which we pick up in + // AppleUnifiedLogger::preventsStderrLogging(), and end up disabling Qt's + // default stderr logger. We prefer Qt's own stderr logging if we can. + environment << "IDE_DISABLED_OS_ACTIVITY_DT_MODE=1"; + cmd2.arg("environment", environment); cmd2.arg("processargs", toHex(ProcessArgs::splitArgs(rp.inferior.command.arguments(), HostOsInfo::hostOs()).join(QChar(0)))); cmd2.arg("platform", rp.platform);