CLion Starts 2020.2 EAP: Performance Fixes, Catch2 and PlatformIO Integration Enhancements, New CMake Actions, and More Accurate Code Analysis

Posted on by Anastasia Kazakova

We’re ready to launch the CLion 2020.2 Early Access Program!

We still have an interesting path ahead of us, but we are now ready to show you some of the valuable improvements we’ve made and to get your feedback. So please join us for this EAP – we’d love to welcome you aboard!

As usual, the EAP builds are free to use and no license is required. The main goal is to test the tools in all kinds of non-standard and unusual environments you may have set up, so we can make sure we haven’t missed anything. If you come across any bugs or peculiar behavior, please report them to our issue tracker so we can collect and fix as many issues and regressions as possible.

DOWNLOAD CLION 2020.2 EAP

Build 202.5103.16 is available from our website, via the Toolbox App, or as a snap package (if you are using Ubuntu).

CLion 2020.2 EAP

Here are the main highlights:

Performance

When you type in the editor, the IDE reparses the corresponding code pieces on the fly to provide you with some smart assistance. Typing inside a macro definition can be tricky for the IDE, as it has to correctly understand the moment the macro ends and the regular code starts in order to update the AST accordingly. To avoid editor performance degradation, CLion now inserts a backslash on pressing Enter inside the macro definition. The macro definition will quite likely be continued on a new line, so the IDE inserts the backslash for you automatically before moving the caret to a new line.

This EAP build also comes with a fix to the IDE freeze that was happening when Sanitizer’s output visual representation was enabled (CPP-16010), as well as a fix to infinitely reading the profiler output in some cases (CPP-20096).

We’ve also reworked the documentation popup to avoid several cases where it blocked the UI.

Unit testing

In terms of Unit testing frameworks, CLion comes with support for Google Test, Catch(2), and Boost.Test. This EAP brings support for Catch2 template tests. They are now recognized and handled just like the other test types:
Catch2 template tests

Debugger for Microsoft Visual C++ toolchain

On Windows, you can select from MinGW, Cygwin, WSL, and the Visual Studio toolchain. In the case of the latter, a debugger implemented by JetBrains based on LLDB is used and it has been given a significant number of improvements:

  • Debug sessions no longer freeze on stop. (This used to happen when the target process spawned another child process that was later detached.)
  • A bug when child members weren’t shown for some values is now fixed.
  • Threads are now named automatically based on their entry-point function.
  • The debugger got significant performance improvements, and many freezes and crashes were fixed.
  • Fixes for stepping issues in multithreaded code, fixes for floating-point type variables and arguments, and much more.

Code analysis and refactoring improvements

The ‘unused code’ inspection now works for type aliases and detects when they are not used. This works for globally and locally defined using:
Unused usings

In CLion 2020.1, Data Flow Analysis was moved to the Clangd-based language engine to enable it to be more accurate and less heavy in terms of performance. We are continuing to work in this direction and have introduced several fixes for DFA-related problems in CLion 2020.2 EAP, including:

  • False warning about unreachable code (CPP-19266).
  • Invalid code block highlighted when an endless loop is detected (CPP-19084).
  • False warning Condition is always false when a value is changed from pointer (CPP-3583).
  • Duplicated DFA notification, and more.

Additionally, CLion no longer suggests replacing the if constexpr condition with the ternary operator – which only makes sense for a regular if else condition. And the Rename refactoring doesn’t fail incorrectly with a Local variable already exists in the scope error (CPP-3054).

Updates to the PlatformIO plugin

CLion 2020.1 introduced a plugin for PlatformIO that helps you start an embedded project faster. A new version is now available and it has been given several significant improvements:

  • Highlighting is now available in platformio.ini files:
    PlatformIO ini
  • Many useful Run/Debug Configurations for running PlatformIO-based projects are now added automatically when a new project is created (previously, only configurations for debug and upload were created).
  • CLion now creates CMake Profiles for the CMAKE_CONFIGURATION_TYPES entries in the PlatformIO CMake project (CPP-19478):
    PlatformIO configurations

CMake IDE actions

There are a few actions for CMake projects now available in Find Action. You can call them from there, or assign a shortcut to any or all of them if you use them often:

  • CMake Settings
  • Stop CMake project reload
  • Open CMakeCache file

CMake actions

VCS: GitHub Pull Requests

Support for GitHub Pull Requests has been improved significantly with 2020.2. You can now fully interact with all the pull requests associated with the repository:

  • Welcome a new and more spacious view for GitHub Pull Requests. Simply double-click on any pull request you need from the list, and the IDE will display all of the information about it, including messages, branch names, author, assignee, changed files, commits, timeline, and more:
    GitHub PRs
  • View the results of pre-commit checks in the dedicated panel.
  • Start a review, request reviews, attach comments, and submit reviews – all from within the IDE.
  • View and interact with comments, both commit level and line level.
  • Merge pull requests from within the IDE.

No more switching to the browser or another tool! The entire Pull Request workflow is at your fingertips in CLion and other IDEs on the IntelliJ Platform. Learn more.

Clangd-based engine update

For quite some time now we’ve had two language engines in CLion – CLion’s own engine and another one that we implement on top of Clangd. The latter is used for code highlighting, completion, code analysis (together with our own code inspections), some navigation actions, and more. We’ve had this engine enabled by default for several releases now and we’re seeing encouraging feedback from our users. We constantly improve it by fixing any cases when the engine crashes or behaves incorrectly, and we do our best to stay aligned with the latest LLVM Clang version. The original CLion engine is not evolving fast enough and many actions in CLion now rely on the Clangd-based engine.

So from now on, the Clangd-based engine is the default language engine in CLion and the option to turn it Off has been removed. Instead, if you experience any issues with this engine, please report them to our team. We’ve also added some information about the LLVM Clang revision used for the Clangd-based language engine so that you know what to expect in terms of C++ support and built-in Clang-Tidy checks:
Clangd settings

And more

Other important fixes include:

  • When you have several independent projects opened in CLion, builds were previously running in sequence (which means one build running was preventing another one from starting). Now they run in parallel.
  • The Recompile single file action is now available for Ninja and other generators used in CMake and supported in CLion.
  • Fixes to Clangd-based completion to make it more accurate and reliable (CPP-19807, CPP-19990, CPP-20121, CPP-20276, CPP-20352).
  • A new setting to specify the default encoding for consoles (used to decode process output) is now available in Settings/Preferences | Editor | General | Console.

The full release notes are available here. There are more than 100 fixes included, so make sure to try out the new EAP build today!

DOWNLOAD CLION 2020.2 EAP

Your CLion team
JetBrains
The Drive to Develop

Comments below can no longer be edited.

34 Responses to CLion Starts 2020.2 EAP: Performance Fixes, Catch2 and PlatformIO Integration Enhancements, New CMake Actions, and More Accurate Code Analysis

  1. Anton says:

    June 4, 2020

    Thank you for your hard work guys!

    • Anastasia Kazakova says:

      June 4, 2020

      Thank you! Much appreciated

  2. Taw says:

    June 4, 2020

    I did not even have the time to play with 2020.1 :)))
    Does this include all the 2020.1 features?

    Also is there a tutorial to work with pull requests in CLion? Can I view the diffs and put comments there for example?

    Thanks

    • Taw says:

      June 4, 2020

      2020.1.2 I mean 🙂

    • Anastasia Kazakova says:

      June 4, 2020

      Please check the linked blog post from IntelliJ IDEA with some more details. The webhelp is on the way as well.

    • Anastasia Kazakova says:

      June 4, 2020

      For sure, 2020.2 includes all 2020.1 features and many fixes in 2020.1 are simply backported from the 2020.2 branch, but not all.

  3. Roman says:

    June 5, 2020

    Jetbrains now have 2 IDEs on Windows that can build my project (Clion and Rider).
    Which one should I prefer? As I understand Rider is not clangd-based. Is it faster or slower than clangd according to your internal benchmarks?

    • ADEV says:

      June 5, 2020

      From my experience using both:

      – CLion is super fast on both linux/macOS, but on Windows it is really slow, maybe because the way they do IO operations?

      – Rider C++ is super fast on windows

      So if you work only on windows, just create a .sln project, and use Rider, it’ll be much better experience

      If you have a crossplatform project then follow this:
      – create a cmake project
      – generate vs project:
      – mkdir build && cd build
      – cmake -G “Visual Studio 16 2019” -A x64 ../

      and do development on windows using Rider, rerun the command if you create/delete new files

      and use clion with the regular cmake project on other OSes

      Unless they decide to fix issues with CLion on windows, then i don’t remember CLion, Rider is much better, at least for windows

      • ADEV says:

        June 5, 2020

        a typo at the end “recomand” and not remember, sorry!

      • Lilian Moraru says:

        June 5, 2020

        Everything that is IO heavy is very slow on Windows though, especially for NVMe(NTFS NVMe performance is nightmare inducing when compared to Linux), etc… It’s not a CLion issue.

        IntelliJ/CLion uses a virtual filesystem, so as long as you give it enough RAM, it should run pretty fast.

        Please follow these tips to improve your performance: https://www.jetbrains.com/help/clion/performance-tuning-tips.html

    • Anastasia Kazakova says:

      June 5, 2020

      Rider is not a general C++ IDE. We added C++ for Unreal Engine and other gamedev support there. It’s based on VS project model, not supported in CLion. So, CLion is still our general offer for C/C++ projects, but Rider can fit if you are in Windows environment with VS project. So the choice should be based on the environment and technologies you are using.

      Regarding the benchmarks, we now have 3 engines in products: CLion’s own one, Clangd-based used in CLion, and ReSharper C++ own one also used in Rider. Clangd-one is not comparable for now fully as there are still limited features working on top (like no refactorings possible there, etc.). CLion’s own one is probably slow on its own in many cases, but in combination with Clangd works good. There is no possibility now to run a comparable benchmark between others, but we are investigating all possible combinations and opportunities to get the best our of what we have now.

  4. Taw says:

    June 5, 2020

    Is there a proper way to get the EAP versions via Toolbox and have also the stable version?
    Currently I am upgrading from stable to EAP and then download also the stable version, which is not very elegant.
    Thanks

    • Anastasia Kazakova says:

      June 5, 2020

      Sure, you can keep both – EAP and stable on your machine.

    • Phil Nash says:

      June 5, 2020

      Yeah, that’s what I always do (all in Toolbox).

      IIRC you just click “install again” next to the CLion icon down the bottom. Make sure one or other is set to update “to Release and EAP” and the other just “Update to Release”.

  5. Taw says:

    June 5, 2020

    1. Where did the lower-right small inspection button go? It was very useful for big files or files that have big macros and CLion cannot handle….(example CPP-9819)
    2. CPP-9819 is not fixed, although the team closed it. I still have big lag when including curl.h

    • Anastasia Kazakova says:

      June 5, 2020

      1. Top right corner:
      Hector
      2. Pls attach new snapshots. We closed as the issues found in the one we have were eliminated​.

  6. Taw says:

    June 5, 2020

    Another question please: why JetBrains includes non-stable non-final clang builds into CLion?
    AFAIK LLVM does not guarantee that current options (e.g. for clang-tidy) will remain the same in final version.

    LLVM (http://llvm.org/):
    LLVM version 11.0.0git
    Optimized build.

    Sometimes it does more harm than good, I get very strange(and stupid TBH) clang-tidy errors now (added in 11)

    Thanks

    • Anastasia Kazakova says:

      June 5, 2020

      What is LLVM stable build in your vision?
      We update to LLVM master to include as many fixes in the language support and stability as possible. This seems to us the most working approach.

      • Taw says:

        June 5, 2020

        Stable release in my opinion is 10: https://releases.llvm.org/
        But I understand your point…

        My problem with this approach is that I have to modify my clang-tidy file, but then LLVM might remove that option just before the release. 🙂
        Same happened with clang-format (not in CLion, in another tool).

        • Anastasia Kazakova says:

          June 5, 2020

          You might use custom Clang-Tidy binary in CLion. The only drawback is that the analysis then is running a bit slower, as the built-in one reuses the Clangd-engine information.

          • Taw says:

            June 5, 2020

            Thanks, the downside of using the latest one is that they add really stupid warnings.

            My code is full of this now:
            https://clang.llvm.org/extra/clang-tidy/checks/llvmlibc-callee-namespace.html
            Really?

            • Anastasia Kazakova says:

              June 5, 2020

              Thanks. Maybe we have consider turning it off by default in CLion.

          • Taw says:

            June 5, 2020

            I really dislike this, sorry.
            If you want speed, use our clang-tidy, but it has many built-ins stupid errors
            Otherwise, use your own, but it will be slower, which I hate in CLion (to be slow)

            This is is lose-lose for me.

            That’s why I preffered a latest released version (10)

            • Anastasia Kazakova says:

              June 5, 2020

              As it was mentioned, in the default profile for Clang-Tidy we disable quite many checks. But you seems to have custom config provided to Clang-Tody.

          • Taw says:

            June 11, 2020

            I explained this in CPP-20634, I like the fact that CLion has always latest-and-greatest clang, but companies are more conservative and use stable releases.

            We are a security company and we do audits, we cannot use a non-released clang 11.

            Except CPP-20634 and CPP-20691, the release is quite stable and a bit faster, I like it.

            Congratulations guys!

            • Anastasia Kazakova says:

              June 11, 2020

              I can’t say that Clang release is significantly more stable than the latest one. We merge often mostly because we see many issues and prefer to get the fixes from the Clang master than to hack on CLion’s side.

              However, we plan to review our default Clang-Tidy configuration to limit the noise.

    • Vladimir Plyashkun says:

      June 5, 2020

      As for llvmlibc-callee-namespace check, it’s indeed disabled by default in CLion.
      You probably have this one enabled, because you’re using .clang-tidy file(s) with custom configuration or modified list of enabled checks in the CLion settings.
      Note that enabling all checks in clang-tidy (simply by passing *) can produce a lot of noise and bogus warnings, because clang-tidy bundles a lot of specific checks which intended only to be used by developers of these projects/libraries (e.g. abseil, zircon, llvm).

      In your case i can recommend append -llvmlibc-* to .clang-tidy file configuration or CLion settings.

  7. Taw says:

    June 5, 2020

    I wonder why the option to hide “ActiveOCBuildConfiguration” from the taskbar dissapeared. (right click on the lower taskbar)
    That information is really unuseful (for me), it just occupied space in the taskbar, but in 2020 EAP I cannot remove it.

  8. Lilian Moraru says:

    June 5, 2020

    This release sounds great all around, thank you!!!!

  9. Алексей Виноградов says:

    June 5, 2020

    Not a fun…
    Everything about build/debug/run buttons became inactive on the first run (at least on the first, not yet restarted).
    Only build/run menu allows me to run debug, which a moment ago works well on usual (non-EAP) build.

    https://yadi.sk/d/lUXw9rDsWMLi7g

    Mac OS mojave

    • Алексей Виноградов says:

      June 5, 2020

      restart helped, sorry for panic.
      However ‘seamless upgrade’ wasn’t successful anyway.

      As a side note (which m.b. related) – on the first run after restart it reported that ‘restructured text’ plugin is failed to load and need to be upgraded. I’ve done so and restarted. M.b. that is anyway related to the issue

      • Anastasia Kazakova says:

        June 5, 2020

        What do you mean by upgrade here? Since there are no patches to EAP from the release builds, I assume you were anyway installing from scratch?

        • Алексей Виноградов says:

          June 6, 2020

          M.b.
          Don’t know the details how toolbox performs this.
          It’s just made active button ‘update’, and I’ve moved from 2020.1.2 to this EAP.

          (I’ve already rolled back, and that is also a bit strange that it rolled to 2020.1.1, so I had then to update to 2020.1.2 with one more click)

          • Anna Filippova says:

            June 8, 2020

            Please check that you have To Release and EAP option enabled in CLion settings in Toolbox App (click the locknut icon in front of CLion – Settings – Updates). That’s why you’ve updated your CLion 2020.1 release version to CLion 2020.2 EAP and downgraded to CLion 2020.1 after that. You can use CLion 2020.1 and CLion 2020.2 EAP versions in Toolbox App simultaneously if you go to Available section and install CLion/CLion EAP there.
            It’s hard to say why Toolbox App rolled up to CLion 2020.1.1 instead of CLion 2020.1.2 without the logs. You can send them (click the locknut icon in the upper right-hand corner and click Show log files at the bottom of the settings window) to toolbox-support at jetbrains.com so we could analyze them.

Subscribe

Subscribe for updates