aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-11-27 11:47:53 +0100
committerEike Ziller <eike.ziller@qt.io>2023-11-27 11:47:53 +0100
commitf9fb628ee3b52d5d4ebfef8b043ce818b5d2ec22 (patch)
treedfae8789aca42f5acf8638e0a8e6bc31a3a5a5d8 /src
parentb76c054961585e9716feb2ecdeed691b6cc9c267 (diff)
parentd7545f9bf5dc6fe77dc3f4b284880467c4e2087c (diff)
Merge remote-tracking branch 'origin/12.0'
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs src/plugins/cppeditor/cppeditorwidget.cpp Change-Id: I618826eaea8acfa65148bd191a0263454bf50e43
Diffstat (limited to 'src')
-rw-r--r--src/libs/3rdparty/cplusplus/Parser.cpp4
-rw-r--r--src/libs/sqlite/CMakeLists.txt1
-rw-r--r--src/plugins/cppeditor/cppeditorwidget.cpp11
-rw-r--r--src/plugins/cppeditor/cppquickfix_test.cpp17
-rw-r--r--src/plugins/cppeditor/cppquickfixes.cpp4
-rw-r--r--src/plugins/cppeditor/cppselectionchanger.cpp2
-rw-r--r--src/plugins/debugger/lldb/lldbengine.cpp8
m---------src/shared/qbs0
8 files changed, 39 insertions, 8 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;
diff --git a/src/libs/sqlite/CMakeLists.txt b/src/libs/sqlite/CMakeLists.txt
index 8d690f3bd46..2c7e1ebbf31 100644
--- a/src/libs/sqlite/CMakeLists.txt
+++ b/src/libs/sqlite/CMakeLists.txt
@@ -41,6 +41,7 @@ add_qtc_library(Sqlite
constraints.h
createtablesqlstatementbuilder.h
lastchangedrowid.h
+ sqlite3_fwd.h
sqlitealgorithms.h
sqlitebasestatement.cpp sqlitebasestatement.h
sqlitecolumn.h
diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp
index d215d2ba4e6..dd49bbec90b 100644
--- a/src/plugins/cppeditor/cppeditorwidget.cpp
+++ b/src/plugins/cppeditor/cppeditorwidget.cpp
@@ -623,9 +623,14 @@ void CppEditorWidget::renameUsages(const QString &replacement, QTextCursor curso
QPointer<CppEditorWidget> cppEditorWidget = this;
CppModelManager::globalRename(cursorInEditor, replacement);
};
- CppModelManager::followSymbol(
- CursorInEditor{cursor, textDocument()->filePath(), this, textDocument()},
- continuation, true, false, FollowSymbolMode::Exact);
+ CppModelManager::followSymbol(CursorInEditor{cursor,
+ textDocument()->filePath(),
+ this,
+ textDocument()},
+ continuation,
+ false,
+ false,
+ FollowSymbolMode::Exact);
}
void CppEditorWidget::renameUsages(const Utils::FilePath &filePath, const QString &replacement,
diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp
index 4dba3176fb3..bc563134756 100644
--- a/src/plugins/cppeditor/cppquickfix_test.cpp
+++ b/src/plugins/cppeditor/cppquickfix_test.cpp
@@ -9224,6 +9224,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 e5417ec6c01..02d5dbb903d 100644
--- a/src/plugins/cppeditor/cppquickfixes.cpp
+++ b/src/plugins/cppeditor/cppquickfixes.cpp
@@ -9514,6 +9514,7 @@ private:
changeSet.remove(block.position() + firstColumn, block.position() + endColumn);
};
const int contentIndex = indexOfActualContent();
+ int removed = 0;
if (contentIndex == -1) {
if (blockIsRemovable) {
removeBlock();
@@ -9531,6 +9532,7 @@ private:
} else {
changeSet.remove(block.position() + firstColumn,
block.position() + firstColumn + contentIndex);
+ removed = contentIndex;
}
if (block == firstBlock) {
@@ -9540,7 +9542,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);
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)
diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp
index fa6fcae29c4..c53baccb72b 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);
diff --git a/src/shared/qbs b/src/shared/qbs
-Subproject 5ef68807776960c90d0572d51af36fc536bbe30
+Subproject 7867c6aaa375e6c7ff3affb67dc6af56df1ecdf