Early Access Program News

CLion 2023.3 EAP5 With the Enhanced Bazel for CLion Plugin and Memory Leak Analysis

According to our Developer Ecosystem survey, 57% of C++ developers used CMake in 2022. However, there are other project models and build systems that are also popular in the C++ ecosystem.

Just a couple of weeks ago, we added Meson support in CLion 2023.3. If you use Meson in your projects, consider giving it a try and sharing your feedback with us.

Another project model that’s growing in popularity among C++ developers is Bazel. We listened to feedback from our users who are migrating their projects to Bazel and using Google’s Bazel plugin for CLion, and we came up with a plan for gradual quality improvements to the plugin. Today is the time to present the results of our work to you!

Grab the fresh CLion 2023.3 EAP5 build (233.11361.11) from our website, via the Toolbox App, or as a snap package if you are using Ubuntu, or update via patch if you are using the previous EAP build. Then, install the Bazel for CLion plugin from our marketplace.

DOWNLOAD CLION EAP

Bazel for CLion

How to install the plugin

You can find the Bazel for CLion plugin in JetBrains Marketplace. The latest version from Marketplace contains all the improvements:

Bazel for CLion

Recent enhancements to the plugin

We addressed several issues with the included headers and CLion incorrectly resolving them:

  • The strip_include_prefix argument is now supported in CLion (#145, #510). In Bazel, when this argument is set, the headers in the hdrs attribute of this rule are accessible at their paths with the prefix cut off. CLion now takes this argument into account as well, looking for included headers by the correct paths.
  • In some cases, CLion was incorrectly navigating to the symlinked header under Bazel’s virtual includes, instead of a proper header declaration (CPP-17658). Since this symlinked file was not a part of the project, code insight didn’t work properly there. We’ve fixed this and code insight now works as expected.

We also addressed some issues related to files that CLion incorrectly treated as unsynced, such as C++ projects that use local_repository or new_local_repository (#4774).

Memory leak analysis

We’ve also added new memory leak analysis. For example, the Allocated memory is leaked warning appears when memory is allocated and the memory is not released before it stops being accessible:

Memory leaked

Another example of the memory leak analysis:
Deallocated memory leak

The new inspection is built on top of data flow analysis. In this EAP build, we also optimized it for very large files so it takes less time.

Other improvements

Code completion is now available for standard nodes in device tree files. Also, The device tree settings are now derived automatically from the CMake Zephyr settings when applicable (CPP-35034).

Structure view is added for meson.build file. It shows executables and libraries if executable(...) and library(...) commands are present in the file.

The full release notes are available here.

DOWNLOAD CLION EAP

Your CLion team
JetBrains
The Drive to Develop

image description

Discover more