forked from qt-creator/qt-creator
ClangFormat: Add parseConfigurationFile utility function
Change-Id: I7824e6bb77e9976aa212cdef478c4d40c4d8c56c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -792,13 +792,8 @@ clang::format::FormatStyle ClangFormatBaseIndenter::customSettingsStyle(
|
||||
return currentQtStyle(preferences);
|
||||
|
||||
clang::format::FormatStyle currentSettingsStyle;
|
||||
currentSettingsStyle.Language = clang::format::FormatStyle::LK_Cpp;
|
||||
const std::error_code error = clang::format::parseConfiguration(filePath.fileContents()
|
||||
.value_or(QByteArray())
|
||||
.toStdString(),
|
||||
¤tSettingsStyle);
|
||||
QTC_ASSERT(error.value() == static_cast<int>(clang::format::ParseError::Success),
|
||||
return currentQtStyle(preferences));
|
||||
bool success = parseConfigurationFile(filePath, currentSettingsStyle);
|
||||
QTC_ASSERT(success, return currentQtStyle(preferences));
|
||||
|
||||
return currentSettingsStyle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user