ClangFormat: Start to use new file management

- Indenter uses .clang-format file from a dir of
editing file or from a parent dir. If there is no
such file then indenter starts to use file from a dir
with the name current CodeStyle settings.
- Test fixed

ToDo: Add file absentness processing in case of import

Change-Id: If09ef0c598899856b948c214e524bcfd5dad76e2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Artem Sokolovskii
2022-04-08 15:12:30 +02:00
parent 3f9c1d5d2b
commit 72dd90e512
8 changed files with 37 additions and 14 deletions

View File

@@ -34,6 +34,7 @@
#include <fstream>
namespace TextEditor { class ICodeStylePreferences; }
namespace ClangFormat {
// Creates the style for the current project or the global style if needed.
@@ -55,4 +56,6 @@ void saveStyleToFile(clang::format::FormatStyle style, Utils::FilePath filePath)
void addQtcStatementMacros(clang::format::FormatStyle &style);
clang::format::FormatStyle qtcStyle();
Utils::FilePath filePathToCurrentSettings(const TextEditor::ICodeStylePreferences *codeStyle);
}