Merge remote-tracking branch 'origin/11.0'

Conflicts:
	src/plugins/clangformat/clangformatutils.cpp

Change-Id: Ide285cc25fca9101843ab9dca01c5a33644aca7f
This commit is contained in:
Eike Ziller
2023-06-14 08:43:08 +02:00
95 changed files with 759 additions and 517 deletions

View File

@@ -7,15 +7,16 @@
#include <coreplugin/icore.h>
#include <cppeditor/cppcodestylepreferences.h>
#include <projectexplorer/editorconfiguration.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectmanager.h>
#include <texteditor/icodestylepreferences.h>
#include <texteditor/tabsettings.h>
#include <texteditor/texteditorsettings.h>
#include <clang/Tooling/Core/Replacement.h>
#include <utils/algorithm.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
@@ -24,6 +25,8 @@
#include <QDebug>
#include <QTextDocument>
#include <clang/Tooling/Core/Replacement.h>
namespace ClangFormat {
Internal::LlvmFileSystemAdapter llvmFileSystemAdapter = {};
@@ -760,7 +763,7 @@ clang::format::FormatStyle overrideStyle(const Utils::FilePath &fileName)
Utils::FilePath filePath = filePathToCurrentSettings(preferences);
if (!filePath.exists())
return qtcStyle();
return currentQtStyle(preferences);
clang::format::FormatStyle currentSettingsStyle;
currentSettingsStyle.Language = clang::format::FormatStyle::LK_Cpp;
@@ -769,7 +772,7 @@ clang::format::FormatStyle overrideStyle(const Utils::FilePath &fileName)
.toStdString(),
&currentSettingsStyle);
QTC_ASSERT(error.value() == static_cast<int>(clang::format::ParseError::Success),
return qtcStyle());
return currentQtStyle(preferences));
return currentSettingsStyle;
}