Early Access Program News

CLion 2023.1 EAP4: Terminal Emulation and Clangd-Based Indexer

The new CLion 2023.1 EAP build (231.6890.13) is available from our website, via the Toolbox App, or as a snap package (if you are using Ubuntu). Update via patch if you are using the previous EAP build.


Terminal emulation in CLion

If you develop curses or ncurses applications in CLion, you previously ran into issues with running and debugging them in the IDE. The terminal emulator was not able to run in curses mode and instead you got an “Error opening terminal: unknown” message. (CPP-822)

This issue is now fixed for a wide range of use cases! For example:
Terminal Emulation

Starting from this EAP build, CLion emulates the terminal in the output console. This behavior is enabled by default and is controlled by Settings/Preferences | Advanced Settings | Run/Debug | Emulate terminal in the output console.
Emulation settings

The availability of terminal emulation depends on:

  • Whether it’s being used for running or debugging, and whether GDB or LLDB is used for debugging.
  • Whether there is an input redirection to the file.
  • Whether the running process is elevated (being run with administrator rights).
  • Whether you’re using local, remote, Docker, or WSL toolchains.
  • Whether you’re using it on a Windows, Linux, or macOS platform.

Terminal emulation mostly works for Unix-based systems and local toolchains. Generally, it doesn’t work on Windows except for running the application locally. You can find the detailed table showing each case here. When emulation is not working, the terminal switches silently to the old behavior.

Clangd-based indexer

CLion has been working with two language engines for a while already: an original language engine written in Java and Kotlin, and a newer Clangd-based engine maintained by our team. There are many features in CLion powered by the Clangd-based engine, like code completion, MISRA checks and data flow analysis, code hints, and others. We also expect it to improve the performance of features that we will migrate to Clangd from our original language engine.

Find Usages, however, is still powered by the original language engine. We’ve seen a few issues in the current approach:

  1. The Find Usages action is not accurate when looking for constructors which can be used for implicit conversion and for implicit conversion operators.
  2. The performance of the Find Usages action might not be satisfactory in some cases.

We are ready to address both issues with the preview of our Clangd indexer!
Find Usages with the new indexer

To give it a try, enable the indexer in Settings/Preferences | Advanced Settings | Clangd | Use Clangd-based indexer:
Indexer settings

After you enable it and restart the IDE, a round-ball indicator will appear in the status bar. It has 3 states:

  • Green means the indexer is ready. After the index is built, searches are instant, no matter how many usages of a symbol there are in the project. This is especially noticeable with symbols that are used across the whole project, or with operators (like =,+,-,*, etc.), because they are usually used almost everywhere.
  • Yellow means an indexer update is in progress.
  • Grey means the indexer is paused.

If you click on the indexer indicator, two actions are available:

  • Clear caches and rebuild can help in the event that something goes wrong and the indexer seems to be broken.
  • Pause can help if you’d like to stop the indexer and free the CPU and memory it’s using.

This is a work in progress, so we’d love to know if the Clangd-based indexer helps you and in which cases it does! Let us know in the comments below. The known issues include:

  • Indexer doesn’t work for WSL toolchain (CPP-32070).
  • All usages are incorrectly treated as Read usages (CPP-32018).
  • No usages are found for the TEST_CASE macro (CPP-32033).
  • No usages are found in lambdas (CPP-32038).
  • No File Structure in the Find Usage view (CPP-32093).
  • Usages include results from system headers (CPP-32016).

Code coverage

You can now filter files in the Coverage view to focus on recently updated files when testing. By default, you’ll see a list of files with uncommitted changes.
Coverage filters

Other fixes in this EAP build include:

  • CMake v3.25 is now bundled.
  • Fixes have been implemented for the Docker toolchain (CPP-29883, CPP-30341).
  • Project tabs in the new UI on macOS were implemented. When you have several projects open, you can now easily switch between them using project tabs displayed under the main toolbar.

The full release notes are here.


Your CLion team
The Drive to Develop

image description