Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 12.0.1
-
None
-
-
c49ec17d0 (14.0)
Description
I enabled "Format while typing" and have my .clang-format file. In older version of QtCreator it was following .clang-format while typing or indenting. Since some version of QtCreator it started to falling back to Qt built-in style while typing and follows .clang-format only if I explicitly use "Format At Cursor" by ClangFormat.
After some research I found out that my .clang-format contained some entry twice, which makes it "problematic" I suppose.
In the current version there are two scenarios, which can be seen in the attached videorecording:
1) .clang-format is correct (no double entry) and typing semicolon inside "else { }" automatically formats by .clang-format rules:
if (true) { ; } else { ; }
2) .clang-format has double entry of "AllowShortFunctionsOnASingleLine" and typing semicolon inside "else { }" falls back to Qt built-in rules:
if (true) { ; } else { ; }
However, if I select that lines and use "Format At Cursor" by ClangFormat it formats correctly as in 1).
I expect that it should not fallback silently to default style, but rather inform user that .clang-format has problems or continue to use .clang-format as in the old versions of QtCreator.
Attachments
Issue Links
- mentioned in
-
Page Loading...
For Gerrit Dashboard: QTCREATORBUG-30087 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
565520,8 | ClangFormat: Allow unknown options in .clang-format file | 14.0 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
565705,1 | ClangFormat: Add allow unknown options checkbox | master | qt-creator/qt-creator | Status: ABANDONED | 0 | 0 |