[Qt-creator] Clang Completion & Format

Eike Ziller Eike.Ziller at qt.io
Mon Oct 25 11:17:40 CEST 2021


Hi,

> On Oct 25, 2021, at 10:43, Björn Schäpers <qt-maillist at hazardy.de> wrote:
> 
> Hi,
> 
> I'm using a self compiled LLVM (recent main with the format patch) and QtCreator (d7c7089ff3ff2877fe89ac09cc2afa9a3da041c0).
> 
> I'm not using clangd, but "plain" Clang Code Model and the Clang Format Plugin.
> 
> I've noticed that completion and highlighting is slower than it was in the latest 4.x version.

Did you compile LLVM in release mode?
Otherwise I see that we apply
https://code.qt.io/cgit/clang/llvm-project.git/commit/?h=release_130-based&id=9dabab650113687b3349e4a71eec1b1c223c4df9
"Cache preamble-related data"
as well.

> But the most annoying thing right now is that my code is not formatted anymore while typing. Before the last modified lines were formatted when I entered a ; or }, but now (with the same config) I have manually to start the formatting and I have to select all the lines I want to format.

There have been some changes there, maybe most notably
ClangFormat: Sprinkle some more magic pixie dust (Ia78ecb9e) · Gerrit Code Review
https://codereview.qt-project.org/c/qt-creator/qt-creator/+/336378
ClangFormat: Prevent adding/removing lines when indenting (Ida6e729f) · Gerrit Code Review
https://codereview.qt-project.org/c/qt-creator/qt-creator/+/358178
and
ClangFormat: Prepend a space character to our inserted line comment (Ic0b53586) · Gerrit Code Review
https://codereview.qt-project.org/c/qt-creator/qt-creator/+/358190

Maybe something broke your case.

> Do I have to change my configuration? Do I have to switch to clangd? My understanding is that that's not complete yet.

Clangd should be complete now in Qt Creator 6, and I'm using it for daily development. It can still have some rough edges here or there though.
Not sure how it could help with your ClangFormat issue though.

Br, Eike

> Currently I sady have not the time to look into the sources to fix it myself.
> 
> Kind regards,
> Björn.
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> https://lists.qt-project.org/listinfo/qt-creator

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Erich-Thilo-Straße 10
D-12489 Berlin
eike.ziller at qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Qt-creator mailing list