No luck beautifying code
-
I'm having some trouble reformatting my code with either the built-in code style, or the beautifier plugin.
When I try to use the built-in code style (cmd+;), it formats my code in an undesirable style. I try to select different code styles in the Preferences, but this seems to have no effect. The code style sample shown under "Preferences/Code Style" is perfect. But when I go to "Auto-format Selection", it formats in a completely different style. No matter what I change in "Preferences/Code Style", it seems to make no difference. It always uses the same super-compact format, not the style I selected.
And when I try to use the Beautifier plugin, "Format Current File" seems to have no effect at all. No matter whether I use Artistic Style, ClangFormat, or Uncrustify, it doesn't do anything. Nothing is being reformatted.
What am I doing (or understanding) wrong?
macOS Sonoma 14.2.1, Qt Creator 12.0.1
-
C Christian Ehrlicher moved this topic from General and Desktop on
-
I'm having some trouble reformatting my code with either the built-in code style, or the beautifier plugin.
When I try to use the built-in code style (cmd+;), it formats my code in an undesirable style. I try to select different code styles in the Preferences, but this seems to have no effect. The code style sample shown under "Preferences/Code Style" is perfect. But when I go to "Auto-format Selection", it formats in a completely different style. No matter what I change in "Preferences/Code Style", it seems to make no difference. It always uses the same super-compact format, not the style I selected.
And when I try to use the Beautifier plugin, "Format Current File" seems to have no effect at all. No matter whether I use Artistic Style, ClangFormat, or Uncrustify, it doesn't do anything. Nothing is being reformatted.
What am I doing (or understanding) wrong?
macOS Sonoma 14.2.1, Qt Creator 12.0.1
I've enabled the Beautifier plugin, set the path to
clang-format
that comes with Qt 12.0.1 on macOS Sonoma, in my case was:/Users/cristian/Qt/Qt Creator.app/Contents/Resources/libexec/clang/bin/clang-format
Set the Use predifined style: File in order to pick up the
.clang-format
configuration file.It worked just fine.