Debugging Rust Code in CLion

It’s been a while since we last dedicated a whole blog entry to IntelliJ Rust. In this post, we’ll take a closer look at how the plugin cooperates with CLion when it comes to debugging your Rust applications.

We’ll start by diving right into a debug session to get a grounding in the basics, and then we’ll explore the debugger settings and additional options in detail.

Continue reading

Posted in Tips'n'Tricks | Tagged , , , , | 15 Comments

CLion 2019.3 EAP: Support for WSL 2 and LLDB 9

Hi,

A new CLion 2019.3 EAP (build 193.4099.17) is now available! Get it from our website, via the Toolbox App, or as a snap package (if you are using Ubuntu). A patch-update for those using the first EAP build will be available shortly.

DOWNLOAD CLION 2019.3 EAP

WSL 2

WSL (Windows Subsystem for Linux) is a compatibility layer for running Linux binary executables natively on Windows 10. CLion supports developing in a WSL environment, which is when you have your IDE launched on a Windows machine, but you target WSL/Linux in your development. This includes providing code assistance using the linked libraries from the WSL and, of course, building, running, debugging, and testing inside the WSL.

Not so long ago Microsoft introduced WSL v2. In a nutshell, its main difference from WSL v1 is that it has a lightweight virtual machine working inside with a Linux core on top. From the user’s perspective, things largely remain unchanged – check out the official Microsoft doc for more details. By the way, you can keep both WSL versions in parallel on your Windows machine.

From the perspective of CLion’s implementation, we had to support the new file system interaction protocol (interestingly, increasing the file system performance was the primary goal for WSL 2) and some networking configuration settings. Now, WSL 2 is enabled in CLion 2019.3 EAP. The great thing is that CLion’s configuration process is completely the same for WSL 1 and WSL 2!

A short configuration guide for you to start:

  1. WSL 2 installation instructions.
  2. See the official notes about placing files that your Linux apps will access in your Linux root file system, accessing network applications using an IP address, and not using localhost.
  3. Follow the CLion’s configuration instructions for WSL.

You are all set up now!
wsl

LLDB 9

The recent release of LLDB 9 is now bundled on macOS and Linux for debugging in CLion.

Faster startup

A few architectural changes in the IntelliJ Platform allowed to reduce startup times in all IDEs based on the platform. And CLion is no exception here! Check the details in this blog post.

The full release notes are available by the link.

Your CLion Team
JetBrains
The Drive to Develop

Posted in Announcement, Early Access Preview | Tagged , , , , , | 9 Comments

CLion 2019.3 EAP and 2019.2.3 Bug-fix Update

Hi,

Today we have a few updates for you. If you’re using a stable release version, there’s a new bug-fix update to v2019.2. And if you’re helping us nit-pick the 2019.3 EAP builds, we’ve got a new build for you.

CLion 2019.3 EAP 2

The Early Access Program for CLion 2019.3 started recently with lots of performance fixes, Clangd-based code completion, updates to remote debugging via gdbserver, and more. Now it’s time for the second 2019.3 EAP build!

Build 193.3793.19 is available from our site, via the Toolbox App, or as a snap package (if you are using Ubuntu). A patch-update for those using the first EAP build will be available shortly.

DOWNLOAD CLION 2019.3 EAP

Python

First of all, Python support is back:
python_back
We sincerely apologize for this delay. We know you were eager to try the first 2019.3 EAP but had to wait because of this issue. Thanks for your patience!

Loading project w/o -fpch-preprocess flag

We’ve got a few reports from users whose compilers don’t support the -fpch-preprocess flag, which CLion uses while reloading the project.

CLion relies on this flag to handle projects that use PCHs. It helps the IDE understand the sources used to create the precompiled binaries, as well as correctly handle any invalid arguments passed to -include. However, this causes issues for some old or embedded compilers that don’t support the flag.

Now, if a compiler doesn’t support the -fpch-preprocess flag and generates an appropriate message about this, the "Reloading Project" process will complete successfully (with a warning status). If you would like to completely disable -fpch-preprocess, please go to Help | Find Action, type Registry and disable the registry option cidr.compiler.gcc.fpch.preprocess.

Other highlights

  • Fixes in code analysis and highlighting:

    • Checks for endless loops are now disabled for functions marked with __attribute__((noreturn)).
    • Fixed a regression with Clangd incorrectly highlighting opening and closing brackets differently (CPP-15273).
  • We’ve added a new option to make the scrollbars more visible. To enable it, go to Preferences/Settings | Appearance & Behavior | Appearance and select the ‘Use contrast scrollbars’ checkbox. Also note that starting with v2019.2, macOS users can configure the editor scrollbar color and opacity at Preferences | Editor | Color Scheme | General | Editor | Vertical Scrollbar:
    scroll_bar_colors

Find the release notes here.
Continue reading

Posted in Announcement, Early Access Preview | Tagged , , | 38 Comments

CLion Starts 2019.3 EAP: Performance Improvements, Clangd-based Code Completion & Remote Debug via gdbserver

Hi,

Today we are launching the Early Access Program (EAP) for CLion 2019.3. We plan to release it by the end of this fall and, as you may remember, it was announced to be a special Quality-targeted Release.

As usual, the EAP builds are free to use and no license is required. The main goal is to test them in all kinds of non-standard or unusual environments you may have set up, and collect and fix as many issues and regressions as possible. So go ahead and grab a fresh build to try it now!

DOWNLOAD CLION 2019.3 EAP

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

CLion 2019.3 EAP

Key highlights:

Clangd-based code completion

To eliminate performance issues and lags, we continue integrating with the Clangd-based engine in the areas where it provides an advantage. This time it’s code completion.

CLion has several providers for code completion, which now include Clangd. The results are shown to you as soon as they arrive, so usually the first results come from the fastest provider. Clangd however produces the results in batches by 100 options. So in the performance metrics shown below, we’ve measured the time (in ms) to get the first 100 results (or fewer, if there are less than 100 results in total). The measurements were taken on a Core i7-8750H PC with 32 GB of RAM running 64-bit Windows 10.

On regular middle-sized projects, the results turned out to be quite similar for Clangd and CLion. However, on projects with known performance issues and lags due to CLion’s code completion, the results are very encouraging.

First comes LLVM (natural choice as we tend to dogfood CLion for Clangd development in the team!):
Code completion: LLVM
For the Eigen library, the acceleration is even more exciting!
Code completion: Eigen

A similar (or even better!) boost can be observed for Boost. For example, for boost::multi_index, nearly any completion for the multi_index_container is way faster (125 ms on Clangd vs 25,000 ms on CLion’s own engine).

For the Qt library, we observed a reasonable boost as well:
Code completion: Qt
You may ask, “Why do you keep the existing CLion code completion engine at all?” The main reason is that it offers additional results that are not yet possible to achieve with Clangd-based code completion. These include, for example, showing not-yet-included symbols, providing some reasonable hints for dependent code in templates, and so on.

So now, it’s up to you to check Clangd-based code completion on your project and see what kinds of speedups you get. Let us know how it goes!

Optimizing Building/Updating symbols step and fixing UI freezes

As we’ve already shared with you, in June our team ran an internal performance week / hackathon (along with the IntelliJ Platform team), playing with several fresh and brave ideas to improve the IDE’s performance. We focused mainly on optimizing the Building/Updating symbols step. The successful experiments have made their way into this 2019.3 EAP build.

Depending on the project and system characteristics, the boost is 10% to 50%, according to our measurements. This is covered by such tickets as CPP-16552, CPP-16991, CPP-16992, and some others. Note that these results are heavily dependent on the specific project, CPU, and environment you’re using, so please let us know whether you notice any improvements in your setup.

In addition, several UI freezes have been fixed:

We will continue coming up with various performance improvements and eliminating freezes, so stay tuned!

Search only for code usages when doing a Rename refactoring

Previously, when you called up the Rename refactoring for a variable, CLion first searched for all usages of the variable, including non-code usages such as string literals and comments. Then it suggested choosing between "Rename All Usages" and "Rename Only Code Usages". This could be very time-consuming and not even needed, if you really just wanted to rename only code usages.

Starting now, the Rename refactoring can ask you to make this decision before the actual search. To switch to such behavior, go to Settings/Preferences | Editor | General | Refactorings and turn off the setting ‘Enable in-place mode’ (it’s on by default). Then, when you press Shift+F6 / ⇧F6, CLion will first suggest the Rename dialog. Clear the checkboxes in this dialog (“Search in comments and strings” and “Search for text occurrences”) so that CLion searches for code usages only:
rename dialog

Launching remote targets automatically under gdbserver

Until now, if you did not use the Full Remote Mode in CLion, but built locally and just wanted to debug an executable running on a remote machine under gdbserver, you had to launch your program under gdbserver manually. Now, the hassle is gone – CLion will do the job for you!

To get it working, create a Remote GDB Server configuration instead of using the GDB Remote Debug configuration. Fill in the credentials of your remote machine and wait for the connection to be established:
Remote GDB debug

Now, if you select this Run/Debug configuration, you can debug on a remote machine via the remote gdbserver.

Other changes

Among other changes you will find:

  • Microsoft’s predefined formatting and naming style was added to the list of predefined styles in CLion:

MS style

  • To prevent situations when virtual functions accesses the resources that are not yet initialized or have already been destroyed, CLion gets a new inspection that detects virtual functions called from constructors or destructors. (Note! The inspection works only when Clangd is enabled.)
  • CMake 3.15 is now bundled.
  • Spell Checker now works in CMake and Doxygen comments.
  • CLion now bundles the Markdown plugin. Note, that if you have a Markdown Navigator plugin installed, this might cause a known issue. As a workaround, remove the Markdown Navigator from the plugin directory and restart CLion.
  • There are lots of improvements coming from the IntelliJ Platform, like smooth mouse scrolling, a timeline for GitHub pull requests, reworked Clone dialog, and many fixes to the JetBrains Runtime. Read about these changes in the IntelliJ IDEA blog.

That’s it for now! Give this build a try and stay tuned for further fixes and improvements!

DOWNLOAD CLION 2019.3 EAP

Your CLion Team

JetBrains
The Drive to Develop

Posted in Announcement, Early Access Preview | Tagged , , , , , , | 74 Comments

CLion 2019.2.2 Bug-fix Update

Hi,

A new bug-fix update, CLion 2019.2.2 (build 192.6603.37), is now available for download from our website, via the Toolbox App, or via snap (for Ubuntu). A patch update will be available shortly. If you haven’t updated to v2019.2 yet, now’s a good time to do so.

DOWNLOAD CLION

Fixes for parameter name hints

CLion 2019.2 introduced a new feature called Parameter Hints. These are the names of function parameters for passed arguments, which are displayed in the editor in line with your code to help increase its readability.

In this bug-fix update, we’ve fixed a few issues related to Parameter Hints in CLion:

  • There is a default black-list now for C++ Parameter Hints. It includes std::min/max, std::forward, std::vector::push_back, strcmp / strncmp, and some others:

Hint blacklist

  • Parameter hints now correctly handle brace elision in aggregate initialization:

Brace ellision

  • In pack expansion, the & hint is now shown for all the parameters.
  • Now, CLion doesn’t show a hint if there’s a comment matching the hint / parameter name. It recognizes comments in the form of /*NAME=*/ (the = can be any character and NAME must match the hint for that argument).
  • A Parameter Hint is now shown before NULL.

Bundled LLDB on Catalina macOS

macOS 10.15 Catalina is gonna be released soon, so we’ve made sure the bundled LLDB works there (CPP-17126). There are still some possible warnings (CPP-17268), but they don’t seem to prevent debugging.

JetBrains Runtime update

Finally, JBR 11 has been updated and addresses the following issues:

  • Fixed the corrupted fonts on the Welcome Screen on Windows (JBR-1777).
  • Fixed the issue that caused incorrect font (italics) in the editor (JBR-1778).

The full list of JBR improvements can be found here.

IDE release notes are also available.

Your CLion Team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , , , | 4 Comments

CLion 2019.2.1 Bug-fix Update

Hi,

CLion 2019.2 was released just a few weeks ago, and now we are ready to give you the first bug-fix update. CLion 2019.2.1 (build 192.6262.62) is now available for download from our website, via the Toolbox App, or via snap (for Ubuntu). A patch update will be available shortly. If you haven’t updated to v2019.2 yet, now’s a good time to do so.

DOWNLOAD CLION

Continue reading

Posted in Announcement | Tagged , , , | 17 Comments

What’s Next? CLion 2019.3 Roadmap

CLion 2019.2 landed just a few days ago. Do check it out if you haven’t yet! It’s got a lot of cool things for Embedded developers, an experimental debugger for the MSVC toolchain, a more flexible and reliable Unused Includes check, parameter code hints, and much more. Here is a fantastic video from Phil Nash to quickly take you through the key highlights.

Meanwhile, we are moving forward and thinking through our future updates and the next release. But before we share our plans, let’s take a minute to give our sincerest thanks to the most active evaluators, who helped us make v2019.2 more stable and accurate.

Special thanks

We want to thank all the users – more than 4 thousand in total! – who participated in the 2019.2 Early Access Program. You helped us immensely with the huge variety of possible setups and configurations, and even a few general issues we somehow missed. We greatly appreciate your help!

Continuing our ongoing tradition, we present our most active EAP evaluators with a full 1-year subscription to CLion, which can be redeemed as a new subscription or an extension of a current one. So, here are the contributors that we want to give special thanks:

  • Dmytro Nezhevenko
  • Ivan Stepanov
  • Patrick Turley

You will receive a personal email with details on how to claim your license. (If for some reason you do not get an email from us within a week, ping us here in the comments!)

CLion 2019.3 roadmap

We take application performance and code quality very seriously. Following the internal performance week / hackathon that our team held together with the IntelliJ Platform team this June, we are now planning a special Quality-targeted Release. Here’s what that means in simple words:

  1. We’ll work to flesh out and implement the fresh ideas and fixes we tried during our performance hackathon.
  2. We plan to work intensively on various performance boosts, including some massive overhauls we started earlier this year. You can expect a series of blog posts covering the progress and explaining the underlying ideas, with some measurements on referenced projects so that you can compare them with your cases.
  3. We plan to focus on fixing issues and eliminating pain-points in different areas, rather than introducing new functionality. (Don’t forget to upvote the pain-points that affect you the most, so that we can prioritize them to help as many users as possible!)
  4. We still plan to continue our work in the directions we feel are important, such as covering Makefiles support and some others. Please read on for the details.

Continue reading

Posted in Announcement | Tagged , , | 45 Comments

CLion 2019.2 has landed with new functionality for Embedded Developers, experimental MSVC debugger, updated Unused Includes check, parameter hints, and much more

CLion 2019.2, the second big update this year, is here now! It brings improvements for Embedded Developers and adds more debugging abilities – including an experimental debugger for the Microsoft Visual C++ toolchain. That’s not all, there’s a fully-reworked Unused Includes check, enhancements in the editor, improved performance, and more.

CLion 2019.2 banner

To update to this version use the Toolbox App, snap package (on Ubuntu), our website, or the patch-update from the latest build of 2019.1.

DOWNLOAD CLION 2019.2

In brief, here are the main improvements:

Read on for the details or check out this short What’s New video by Phil Nash:

Continue reading

Posted in Announcement | Tagged , , , , , , , , | 27 Comments

CLion 2019.2 Release Candidate is Here

Hi,

Please welcome the Release Candidate for the upcoming CLion 2019.2!

To install CLion 2019.2 RC (build 192.5728.70), download it from the website, update from our Toolbox App, or use a snap package (for Ubuntu). Please note that to use CLion 2019.2 RC, you need to either have an active subscription or start a 30-day evaluation period. No patches are provided for this release candidate, but you can expect a patch from the latest 2019.1.4 update to the 2019.2 release version.

DOWNLOAD CLION 2019.2 RC

This builds brings some cosmetics updates to the recently added Peripherals View. We’ve also fixed some issues related to that view, like having to click the load button twice (CPP-16730) and some incorrect cells coloring in the table (CPP-16746).

In the 2019.2 EAP builds, we’ve enabled an experimental LLDB-based debugger for the Microsoft Visual C++ toolchain. It was also available for MinGW under the same experimental setting. However, while the debugger for MSVC is more or less stable and the improvement path is clear enough, for MinGW the quality was not satisfactory. We’ve decided to turn it off for now, even under the experimental setting, leaving only the MSVC debugger available.

The full release notes are available here.

Your CLion Team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , , | 15 Comments

CLion 2019.2 Hits Beta

CLion 2019.2 goes Beta! To install CLion 2019.2 Beta (build 192.5728.28), download it from the website, update from our Toolbox App, get it through a snap package (if you are using Ubuntu), or use a patch update.

DOWNLOAD CLION 2019.2 BETA

blog@2x

Beta builds are much more stable than EAP builds, but some issues may still occur. If you find any issues, please report them to our issue tracker. You don’t need a license to use this build.

The main highlights:

  • The updated ‘Unused includes’ check no longer hangs in a batch mode (run via run inspection by name)
  • A fix for the issue with the freezing rename refactoring when invoked from the context menu (CPP-16768)
  • A fix for the code highlighting disappearing after a file was saved when the parameter name hints were enabled (CPP-16741)

The full release notes are available here.

Your CLion Team,
JetBrains
The Drive to Develop

Posted in Announcement, Early Access Preview | Tagged , , | 32 Comments