CLion Starts the 2022.2 EAP: Colorized Ninja output, Embedded GDB Server Wizard, Updated CMake Presets Integration
The CLion 2022.2 Early Access Preview program starts today!
Give the free EAP builds a try and let us know what you think about the changes! Share your feedback in the comments or submit it to our issue tracker.
Build 222.2270.30 is available from our website via the Toolbox App or as a snap package (if you are using Ubuntu). Note that if you are on macOS, there is a separate build for Apple Silicon (M1 chip).
Here are the main highlights:
- Colorized output for Ninja generator is now enabled in CLion.
- A new wizard was added for Embedded GDB Server run configurations.
- Code analysis and refactorings became more accurate.
- Code completion was improved.
- CMake Presets integration got updated.
Colorized Ninja output
Colorized compiler output helps dealing with compilation errors much faster. That’s why we contributed to CMake and implemented a way to enable colorized output for the Ninja generator in CMake in CLion by default. The change is now in CMake master and will be released as a part of the 3.24 release of CMake. It introduces the CMAKE_COLOR_DIAGNOSTICS CMake variable that controls the following:
- Whether CMake should enable colored compiler diagnostics via compiler flags.
- The CMAKE_COLOR_MAKEFILE variable.
Additionally, we added support for the CMAKE_COLOR_DIAGNOSTICS environment variable, which controls the default value for the CMAKE_COLOR_DIAGNOSTICS variable. CLion now always adds the CMAKE_COLOR_DIAGNOSTICS=ON environment variable when re-loading the CMake project. This ensures that there will be colored diagnostics for both Ninja and Makefile generators.
Note, that the default bundled CMake version is 3.22 for now. To get the colorized output, you need to build CMake 3.24 and use it in the CLion toolchain.
A new wizard for Embedded GDB Server run configurations
GDB servers are often used to debug on-chip. In CLion, you can use them by creating the Embedded GDB Server run/debug configuration. Previously, you had to create such configurations manually, but now there’s a wizard available for this purpose. This wizard helps with creating Embedded GDB Server run configuration with the predefined GDB server arguments corresponding to the GDB server type selected in the wizard settings.
Launch the new wizard via Run | New Embedded Configuration. In the dialog that opens, enter the configuration name and the preferred type of the GDB Server:
- Segger JLink
- QEMU emulator
- STM32CubeIDE ST-LINK GDB server
- PE Micro (OpenSDA)
When the GDB server’s expected name is found in PATH, the location of the server is resolved automatically:
Click Next and get the list of devices to select from:
After you click Create, you’ll get the Embedded GDB Server run/debug configuration created with the GDB server args set according to the wizard preferences. You can adjust the settings later if you want:
More accurate code analysis and refactorings
We’re continuing to make code analysis in CLion more accurate:
- “Condition is always true/false” message is not duplicated now when a constant variable is used in condition (CPP-21829).
- We optimized the way MISRA and Clang-Tidy settings from the UI are passed to the actual call (CPP-28568).
- We fixed a regression problem with the false Clang-Tidy warning shown for the TEST macros (CPP-28309).
- Make Clangd correctly recognize the
Code intentions and refactorings also got a few fixes:
- Intention Add braces to
forstatement no longer inserts an unnecessary semicolon and can now preserve the user’s comments (CPP-28879).
- The refactoring invert
ifcondition no longer results in broken code if the condition has an inverted macro (CPP-28620).
Improved code completion
We’re continuing to make CLion Clangd-based code completion more accurate and useful:
- Code completion no longer ignores namespaces inside templates (CPP-28297).
- CLion now suggests class names in the completion lists after the
- Do not show
__1namespace in completion list (CPP-29042).
- We improved the conversion limitations for postfix completion and brought them in line with the limitations that are used for smart completion (CPP-28630).
- CLion now doesn’t show the postfix completion for bit fields (CPP-25873).
In CMake, Qt-related commands were added to completion lists (CPP-28811):
When auto-creating CLion profiles for all the configure and build presets defined in the CMakePresets.json and CMakeUserPresets.json files, CLion now uses a new naming scheme for the CMake profiles created in CLion:
- Configure presets are imported with
- Build presets are imported as a
configure-preset-name - build-preset-namecombination.
We’ve also enabled a copy action for profiles created from presets so you can edit them in CLion.
Have you tried the CMake Presets integration in CLion? Feel free to share your feedback with us!
- To improve the performance of the compiler information collection in the case of Docker toolchain, CLion now uses docker
- Valgrind Memcheck no longer shows the incorrect error about the failed download of the specific files when launched in the remote mode.
- CLion now notifies users when Valgrind Memcheck is launched for the release configuration and the debug information is missing for the executable as a result.
Your CLion team
The Drive to Develop