11/6/2022 0 Comments Clion clang formatYou can override them with either global Qt Creator settings or with specific settings for your project. clang-format configuration which it finds according to the standard clang-format rules. #CLION CLANG FORMAT CODE#'Format while typing' will try to reformat code automatically if possible and 'Format edited code on file save' will go through and format the edited lines in the file you are saving.īy default the plugin uses the. There are a few more checkboxes to customize the plugin behavior. We have decided that it's a good idea to apply formatting on the same hotkey as indentation (Ctrl+I) but only when the checkbox is selected in Tools > Options > C++ > Code Style > 'Format instead of indenting'. With the plugin you can not only indent but also apply standard clang-format formatting which will optimize lines if possible, remove trailing white space and empty lines, etc. To enable the plugin go to Help > About Plugins, click on ClangFormat and restart your Qt Creator. But it can potentially bring much more in the future. So the main purpose of our new ClangFormat plugin is to indent the code properly. But the reality is that Qt Creator indentation still does not fully support modern C++. For example we already have these bugs for quite a long time Qt Creator indentation bugs and they always raise our desire to fix them altogether. Since ages Qt Creator has its own indentation engine to provide you the proper white space where necessary. The same thing happens when you press Return or move/paste some code into the C++ editor. I assume that you already use Ctrl+I to have your code indented. We're not planning to remove any of this functionality because it serves its purpose pretty well and can be customized to the clang-format version that you prefer to use in your project.īut Beautifier does not cover other important cases, it's only a tool to finalize your code. You edit your code, you format it when you're done. The clang-format tool could already be used in Qt Creator before as part of the experimental Beautifier plugin along with Uncrustify and Artistic Style. If you have this plugin enabled you can simply invoke the executable by the shortcut or apply formatting on save. Let's shortly recall the history of ClangFormat support and why we've decided to have a new plugin. In 4.9 it is not experimental anymore but still disabled by default. Starting with Qt Creator 4.8 we ship the new ClangFormat plugin based on the LibFormat library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |