What's New in CLion

CLion 2022.3 provides better user experience across the board, from projects with only a couple C/C++ files to complex CMake-based applications. It also helps you adopt modern C++20 features and work in embedded and remote setups more productively.

CMake

CMake Debugger

CMake Debugger

Since CMake is a language of build systems, investigating errors and catching suspicious behavior in a CMake script is not always easy. With CLion 2022.3 you can now debug CMake scripts as regular code. Set breakpoints, step through code, and watch CMake variables and targets.

Learn more.

Code assistance in CMakeLists.txt

The CMake file editor in CLion has been enhanced with new abilities to help you edit CMakeLists.txt files more easily. This includes:

  • CMake font and color settings, which you can find in Settings | Editor | Color Scheme | CMake.
  • The ability to expand and collapse various code regions in CMake.
  • Code completion for find_package for packages bundled with CMake.
  • CMake command documentation in code completion.
  • CMake structure view.
  • Strikethrough highlighting of deprecated commands in CMake.

Add to CMake Project

When there is a file in your CMake-based project that doesn’t belong to any CMake target, CLion code assistance is limited in that file. A new Add to CMake Project quick-fix shown on the notification bar will help you add a file to the existing CMake target.

The action is also available in the project view context menu when called on the file.

CMake targets with root privileges

CMake targets with root privileges

If you add a CMake target as an extra task before starting the selected run/debug configuration, the target can now be run with administrative privileges.

Learn more.

C++20 modules

Modules were introduced in C++20 to reduce many of the problems associated with the use of header files by isolating declarations and keeping their visibility limited to the module. There is also the hope that modules will be able to reduce compilation times in many cases. CLion 2022.3 provides module support to help you use this great language feature.

Syntax highlighting

Syntax highlighting

CLion collects and parses information about modules from all .ixx, .cppm, and .mxx files in the project. Then it provides syntax highlighting for the new module keywords like import, export, and module.

Completion

Completion

CLion provides code completion for symbols from modules.

Navigation

Navigation

With CLion, you can navigate to declaration/definition for symbols from modules in one click.

Find Usages and refactorings

Find Usages and refactorings

Both Find Usages and refactorings work as usual inside modules.

An early version of the Rename, Change Signature, and Extract refactorings that cross module boundaries work only for files opened in CLion.

Learn more about CLion’s support for C++20 modules and the known limitations.

Single file

If you have just one or two C++ files that you write code in and then want to compile and run, you no longer need CMake or another project model to open them in CLion. There is a new option to compile and run a single C or C++ file!

A new C/C++ File configuration

A new C/C++ File configuration

A new run/debug configuration type (C/C++ File) allows you to quickly configure the toolchain, source files, and compilation options. When created, it allows you to compile and run the selected files.

Run icon

Run icon

When you open a C/C++ file or a folder via the Open action in the Welcome wizard, the run icon appears in the left gutter and allows you to run or debug the current file.

A C/C++ File configuration is required, and when missing, is created automatically when you click on the run icon.

When debug is selected, CLion automatically adds the required compiler flags for generating debug information (i.e. -g for GCC and Clang, or similar options for MSVC), so no changes in the configuration are required.

Linker scripts

If you develop for embedded systems, chances are that you need to write linker scripts. CLion 2022.3 now comes with Linker Script (LD) language support, which includes:

  • Code highlighting in LD files, which you can configure in Settings | Editor | Color Scheme | LinkerScript.
  • Code completion.
  • Structure view for top-level commands.
  • Code folding for sections, memory, and phdrs.
  • Code commenting / uncommenting.
  • Find Usages for simple cases.

Clang-Tidy enhancements

Clang-Tidy enhancements

The Clang-Tidy binary was updated to v16.0.0 in this release, bringing new checks and various LLVM fixes.

The Clang-Tidy settings (Settings | Editor | Inspections | C/C++ | Static Analysis Tools | Clang-Tidy) were updated and the detailed documentation is now rendered on the left-hand side.

In the Clang-Tidy tooltip in the editor, click on the kebab (three dots) icon on the right-hand side and choose Show Inspection Description to get a short description of a Clang-Tidy check. Use the special Learn More link to navigate to the settings dialog and find out more details about the check.

Documentation

The size of the type

The size of the type

The Quick Documentation popup now shows the size of the type. Similar to other inspections, this one uses the flags from the project model that CLion passes to Clangd. This allows the IDE to calculate the correct size even in cross-compilation cases.

Documentation at cppreference.com

Documentation at cppreference.com

CLion can now help you learn more about the standard functions, structures, and other parts of your code base. Use the link in the Quick Documentation popup or the External documentation (Shift+F1) action to open cppreference.com articles in a web browser. This works for anything with a definition in the std namespace that is likely to have documentation there.

Debugger

The size of the type

Function return value

When you step out of a function that has a non-void return type, CLion now shows its return value in the debugger tool window’s Variables view.

On macOS and Linux, the bundled LLDB version has been updated to LLDB 15.

RTOS thread view

RTOS thread view

When debugging with RTOS, CLion provides a view of tasks (threads). Starting with CLion 2022.3, this also works for Symmetric Multiprocessing (SMP) if the processor cores are identical.

In addition to FreeRTOS and Zephyr, the view has also been enabled for Azure RTOS.

New UI

IntelliJ-based IDEs are receiving a new UI. Modern and clean, it aims to reduce visual complexity, provide easy access to essential features, and progressively disclose complex functionality as needed.

Tool windows and features specific to C and C++ are now ready for the new UI! Ready to give it a test drive? Switch to it in Settings | Appearance & Behavior | New UI.

Settings synchronization

Settings synchronization

A new solution for synchronizing settings is now available in all IntelliJ-based IDEs, including CLion. The new Settings Sync plugin is capable of syncing all shareable settings from the platform, bundled plugins, and third-party plugins. The settings are stored in the cloud attached to the user’s JetBrains Account. If you use different IntelliJ-based IDEs associated with the same user account, your settings will be automatically synced.

Learn more.

Profiling

Profiling

When profiling on a remote or embedded target, you can now import the results locally in CLion via Run | Open Profiler Snapshot. Jump to Source navigation works correctly for profiling data and continues to do so after import/export.

Remote and WSL2

Remote and WSL2

CLion now provides an alternative way to work with projects in WSL2 (Windows Subsystem for Linux 2) via remote development. Instead of running a full IDE on Windows, your IDE backend will launch directly in WSL2 itself. Then you can connect to it the same way you would connect to any remote machine when using remote development.

To improve the performance of remote development with local sources, CLion now uses pigz (a multithreaded gzip implementation) for compression on the remote host to synchronize the header search paths back to the local host.

For remote development with local sources, you can avoid the CMake build folder synchronization after CMake reload by selecting the Local or mounted folder deployment type in Settings | Build, Execution, Deployment | Deployment.

Other enhancements

  • CLion now bundles all default web development plugins from WebStorm (NodeJS, Karma, AngularJS, and others).
  • IAR language extensions are now supported in CLion. The code is parsed and highlighted correctly.
  • With CLion 2022.3, we have started distributing installers for Windows ARM64. Native tools like Clangd are not yet ported to the platform, so installers only work for Windows 11, which is able to run both x64 and x86 binaries.

What's New in CLion 2022.2

The CLion 2022.2 release integrates better with CMake and CMake presets. The Quick Documentation popup has become a useful source of knowledge about your C++ and CMake code. Enhanced static and dynamic code analysis, better debugger integration, and performance improvements for remote and Docker toolchains help you develop more productively.

CMake integration

CLion now comes with CMake 3.23 bundled. It integrates better with CMake presets and makes updating CMake scripts and options easier.

Quick Documentation in CMake

Quick Documentation in CMake

The Quick Documentation popup is now available in CMake scripts. The documentation is shown for the standard CMake entities:

  • Commands
  • Policies
  • Modules
  • Variables
  • Properties

Documentation is always rendered for the currently bundled CMake version and is not available for the user-defined entities for now.

Qt-related command completion

Qt-related command completion

While editing CMake files in CLion, you can use auto-completion for CMake commands and variables with static names. In v2022.2, Qt-related commands were added to completion lists.

CMake Cache viewer and options editor

CMake Cache viewer and options editor

In CLion 2022.2, you can now review CMake cache variables and update CMake options that are passed to the CMake command in a single table-based UI in Settings | Build, Execution, Deployment | CMake.

When the table is in focus, start typing to search for a variable or its value. CLion also shows the short description in tooltips for CMake cache variables.

Learn more.

CMake presets

CMake presets

When auto-creating CLion profiles for all the configure and build presets, CLion now uses a new naming scheme for the CMake profiles created in CLion:

  • Configure presets are imported with the name configure-preset-name.
  • Build presets are imported as a configure-preset-name - build-preset-name combination.

A copy action for profiles created from presets is enabled.

Colorized Ninja output

Colorized Ninja output

Colorized compiler output helps users deal with compilation errors much faster. That’s why we made our own contribution to CMake v3.24. We implemented a way to enable colorized output for the Ninja generator in CMake in CLion by default.

Note: CLion bundles CMake v3.23 for now. To get the colorized output, you need to get CMake 3.24 and use it in the CLion toolchain.

Code documentation

The Quick Documentation popup (Ctrl+Q) is a universal tool to help you get more information on a code element at the caret. By default, CLion shows quick documentation in a popup on mouseover automatically. In v2022.2, CLion has added more code insight to this documentation.

Values of constant expressions

When reading through the code base, you often want to check the value of constant expressions. CLion now shows the value of the expressions evaluated at compile time in the Quick Documentation popup. This works for consteval, constexpr, or template instantiations, just to name a few examples.

Enum values

Enum values

CLion 2022.2 makes it possible to see the enum value as an integer in the Quick Documentation popup.

Copyable and movable

Copyable and movable

It can be useful to see whether a given struct or class declaration supports copy and move operations, so CLion now shows this information in the Quick Documentation popup.

Embedded development

Embedded development

GDB servers are often used to debug on-chip. A new wizard helps with creating Embedded GDB Server run configurations with the predefined GDB server arguments corresponding to the GDB server type selected in the wizard settings. The supported types are:

  • Segger JLink
  • QEMU emulator
  • PyOCD
  • St-util
  • STM32CubeIDE ST-LINK GDB server
  • PE Micro (OpenSDA)

Learn more.

Static analysis

We’re continuing to make code analysis in CLion more accurate. CLion 2022.2 removes many incorrect warnings, adds new checks, and makes Clangd correctly recognize the -std=gnu++23 option.

Interval analysis

CLion’s data flow analysis now calculates the upper and lower bounds of the possible values for every integral variable. This provides extra information for checks like Unreachable code, Constant conditions, and others.

On top of this interval analysis, the Array index is out of bounds check is built. It reports variables that access an array or allocated buffer via the index which may be out of bounds.

Learn more.

A new Clang-Tidy widget

A new Clang-Tidy widget

If you prefer Clang-Tidy configuration files over IDE settings, select this option in Settings | Editor | Inspections | C/C++ | Static Analysis Tools | Clang-Tidy. In this case, a new widget will appear in the bottom right-hand corner of the editor:

  • If there is no file with settings, the widget will help you create one.
  • If you’d like to know what exact Clang-Tidy configuration CLion is using to analyze the current file, you can open it via the new widget.
Highlighting configuration

Highlighting configuration

The inspection settings in Settings | Editor | Inspections now visualize the highlighting style. When you want to change how an inspection appears in the editor, you can set it up using the new Highlighting in editor drop-down menu, which conveniently shows all available highlighting styles.

Dynamic analysis

Dynamic analysis

Valgrind Memcheck is a tool integrated into CLion for detecting memory usage problems. In v2022.2, we’ve enhanced the way configuration issues are reported. CLion now notifies you when Valgrind Memcheck is launched for the release configuration and the debug information is missing for the executable as a result.

Debugger

Symbol servers on Windows

Symbol servers on Windows

When debugging, sometimes the library symbols are not available on your local machine. In this case, you can use a symbol server, a file server that stores your debug symbols centrally on a server rather than on each developer’s machine. In CLion on Windows, you can now configure symbol servers for the debugger in Settings | Build, Execution, Deployment | Debugger | Symbol Servers.

Learn more.

Bundled GDB and LLDB

Bundled GDB and LLDB

CLion v2022.2 bundles GDB v12.1 and LLDB v14.

Remote development

Remote Development

When using remote development with local sources, the initial synchronization step might take quite some time. CLion 2022.2 uses rsync to synchronize your deployment configuration. Our measurements have shown that this leads to a significant improvement in performance.

Learn more.

Docker

Performance improvement

To improve the performance of compiler information collection for the Docker toolchain, CLion now uses Docker exec instead of run.

Environment

Usually toolchains in Docker images have an environment file located inside the image. CLion now correctly picks the file from inside the container.

Rust plugin updates

Rust plugin

IntelliJ Rust now takes #![recursion_limit] into account, which controls the macro expansion depth. If you don’t need macros to expand fully, you can adjust the Maximum recursion limit for macro expansion setting.

We’ve also enabled the new approach to detecting changes in configuration files, as well as a new way to reload project models.

Other IntelliJ Rust plugin improvements:

  • The plugin can now convert JSON to Rust structs via copy-paste.
  • We’ve added inspections and quick-fixes for unused_must_use and clippy::double_must_use lints.
  • The plugin now parses generic parameters, type aliases, and type bindings of generic associated types.
  • If the Emulate terminal in output console option is enabled, the proper terminal is now used.
  • We’ve implemented some improvements for type inference, including unsized coercion.
  • URLs are highlighted and you can open them in a browser.

Space integration

Review in Space

Space integration is now bundled with CLion 2022.2. With the first-class integration, you can browse Space projects and clone repositories, then start working on them directly. When your changes are ready, you can create a merge request and perform a code review from within the IDE.

Other enhancements

  • The support for CUDA development in CLion has been enhanced. CUDA compilation database projects are now supported in CLion. And the CUDA-gdb debugger integration was fixed to allow you to step out from CUDA calls correctly.
  • CLion v2022.2 enables system header indexing for the Microsoft Visual C++ toolchain. This makes auto-import work for such headers.

What's New in CLion 2022.1

The CLion 2022.1 release is focused on quality improvements. It enhances existing workflows for remote development, Docker, CMake projects, and CUDA debugging, as well as addresses the most annoying bugs in code completion, inlay hints, and other subsystems.

Remote Development

Remote Development

The new remote development workflow is now bundled into CLion and available from CLion’s Welcome screen. Use a powerful remote machine to execute all IDE operations and to build, run, and debug code – all while running the IDE on a local thin client.

Cloud dev environments featured in Space can now be used with CLion to speed-up onboarding, get a ready-to-use IDE in seconds, and manage your development resources efficiently. Learn more about Space dev environments.

Learn more about remote development with the thin client or consider the other types of remote configurations available in CLion.

Docker

Docker

When working with the Docker toolchain, you can now provide additional container settings, such as port and volume bindings, and so on.

The Valgrind memcheck tool for detecting memory-usage problems now works with the Docker toolchain.

CMake

CMake is a first-class citizen project model in CLion. Version 2022.1 addressed inconsistencies and lack of configuration abilities in the core areas of CMake support – CMake presets and CLion CMake profiles.

CMake Presets

CMake Presets

CLion now automatically creates CMake Profiles for configure presets (it was only available for build presets before). The change makes the configuration process easier and allows the removal of redundant build presets.

CLion now also works with the --preset argument passed to the cmake command. The data from the preset is loaded into build type, toolchain, and build directory settings.

CMake Profiles reloaded sequentially

CMake Profiles reloaded sequentially

When the parallel reload of CMake profiles is not possible, CLion can now reload them sequentially. You can enable this behavior in Settings | Advanced Settings | CMake.

CMake Generators

CMake Generators

CMake generators are now easier to configure in CLion with the new and updated options:

  • Use default – for new projects, this option now takes the build tool configured for the toolchain selected in the corresponding CMake Profile.
  • Let CMake decide – this option means CLion won’t be favoring any CMake generator explicitly, meaning that CMake will decide what generator to use.
CMake Profiling

CMake Profiling

In CLion, you can now visually inspect why it takes a long time to reload your CMake project. Starting with CMake 3.18, the new tracing can be enabled in the CMake settings. CLion will help you run the tracing and visualize the results. Learn more.

CMake Formatting

CMake Formatting

CMake scripts are now formatted more accurately:

  • if() .. endif(), else() and elseif(), endforeach(), endfunction(), endmacro(), and endwhile() are aligned correctly.
  • It is now possible to fold blocks for these commands.
  • Brace pairing and code block highlighting are available for these commands as well.

Debugger

CUDA debugger

CUDA debugger

The CUDA-GDB debugger can now be used in CLion. To make it work, you’ll need to specify the cuda-gdb binary in the debugger setting of your current toolchain, and use the following compiler option:

add_compile_options(-G) to add CUDA debug symbols.

Debugger UI update

Debugger UI update

In the layout settings of the debugger tool window there are two new options available:

  • Separate Watches: enables you to use a separate tab with watches.
  • Show Tab Labels: enables you to use debugger tool window tab names.
Hex values in debugger

Hex values in debugger

The option to show both decimal and hex values in the debugger now works for LLDB on Windows (Settings | Build, Execution, Deployment | Debugger | Data Views | C/C++ | Show integers as hex values and Display alongside the original value).

Embedded Development

Embedded GDB Server

Embedded GDB Server

The Embedded GDB Server configuration can now reset the device at different stages:

  • Before or after the download (i.e. flashing MCU ROM or writing to RAM).
  • Always (both before and after).
  • Or never.

Macros now work in Embedded GDB Server configuration fields.

FreeRTOS

FreeRTOS

The FreeRTOS GCC/Posix port is now supported and enables FreeRTOS debugging on Linux.

Code Analysis

With code analysis being a key part of the IDE, we’ve been working to make it more accurate and easier to configure, and to make its notifications more informative.

Preview for intention actions

Intention action suggestions are available via Alt+Enter (alternatively, click the bulb icon). In the suggestions list, now you can also see a preview of the result of the selected action. The preview is available for De Morgan's laws, invert if condition, merge if-else, merge nested if, Clang-Tidy, MISRA, Clazy, split into declaration and assignment, split into separate declarations, and a few other actions. Learn more.

Updated Clang-Tidy and MISRA settings

Clang-Tidy and MISRA settings in Settings | Editor | Inspections | C/C++ | Static Analysis Tools were reworked to make the checks configuration process easier. A new visual representation includes a tree with all the checks. Speed search helps you find the required checks quicker – just start typing the name you are looking for when the dialog is in focus.

For Clang-Tidy, the dialog also links to LLVM documentation to help you learn about the checks in more detail.

More accurate code analysis

The accuracy of the code analysis engine in CLion was increased by addressing a selection of issues, for example:

  • Condition is always false/true checks now work correctly with types and narrowing conversion.
  • CLion no longer marks fields as unused if they have non-trivial destructors.

Inlay Hints

Parameter and type hints in CLion are now more informative and accurate for modern C++ code.

CLion now displays a user-friendly wstring alias as a type hint for the std::basic_string<wchar_t> type.

CLion now displays an accurate type hint for dependent types.

CLion 2022.1 added parameter info for struct literals and initializer list, as well as made parameter hints more informative for the emplace, emplace_back/emplace_front, and make_unique/make_shared functions.

Hints for array indices can now be disabled if you don’t need them.

Formatter

Formatter

New formatter options for structured bindings were added to Spaces and Wrapping and Braces sections.

UX improvements

Small but helpful UX improvements were introduced to make everyday IDE actions more convenient and powerful.

Namespaces in the New C++ Class dialog

Namespaces in the New C++ Class dialog

When creating a new C++ class, you can now specify the namespace where you’d like the new class to be located. You can write in any existing or nonexistent namespace (which will be created along with the new class), a nested namespace, or even an anonymous (unnamed) namespace if you enter a blank space in this field.

Grouping in the Structure view

Grouping in the Structure view

In the Structure view, elements can now be grouped by the qualified name. Select between grouped view or plain view with a fully qualified name included in each element name.

Rust

Rust

A new stub project generator for Rust projects will help you even if you don’t have the Rust plugin installed. It will help you install the plugin and navigate you through project creation.

Other enhancements

  • In the Toolchains settings (Settings | Build, Execution, Deployment | Toolchains) you can now configure any build tool to be used with a toolchain, such as Make, Ninja, or others.
  • For library files, CLion no longer shows the This file does not belong to any project target notification.
  • Incorrect Clang-Tidy results that used to occur when the WSL toolchain was used are now fixed by executing Clang-Tidy inside WSL itself.