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:
@@ -305,10 +305,8 @@ std::string ClangFormatConfigWidget::readFile(const QString &path)
|
||||
file.close();
|
||||
|
||||
clang::format::FormatStyle style;
|
||||
style.Language = clang::format::FormatStyle::LK_Cpp;
|
||||
const std::error_code error = clang::format::parseConfiguration(content, &style);
|
||||
QTC_ASSERT(error.value() == static_cast<int>(clang::format::ParseError::Success),
|
||||
return defaultStyle);
|
||||
bool success = parseConfigurationFile(FilePath::fromString(path), style);
|
||||
QTC_ASSERT(success, return defaultStyle);
|
||||
|
||||
addQtcStatementMacros(style);
|
||||
std::string settings = clang::format::configurationAsText(style);
|
||||
|
||||
Reference in New Issue
Block a user