CLion 2019.3 EAP: C++20’s Concepts, Go to Header/Source, and .lldbinit
A new CLion 2019.3 EAP (build 193.5096.27) 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 anyone using the previous EAP build will be available shortly.
- Support for C++20’s Concepts
- Action to switch between header/source files
- Reading .lldbinit from the project root
Support for C++20’s Concepts in CLion
Concepts are one of the biggest and most important features coming in the C++20 standard. We’ve been collaborating with Saar Raz, the author of the Concepts support in Clang, and have merged his Clang branch into our custom Clangd-based language engine in CLion, and implemented a few things on top:
- Parsing and custom highlighting
- Code inspections, like Unused Concept
- Code completion
- Completions on template type parameters that are constrained
- Completion for types constrained by
- Refactorings and navigation actions for Concepts
- Go to Definition
- Find Usages
To learn more about CLion’s support for C++20’s Concepts, please see our dedicated blog post.
Action to switch between header/source files
To switch between header/source files, CLion has offered Go to Related Symbol. This IntelliJ platform action is smart as it tries to find related symbols across the whole project, but it may also cause some issues and inaccuracies when used for switching between header/source use case:
- It tries to locate the cursor in the newly opened file on a related class/function definition, which is often inconvenient.
- It tries to find the best option and just goes there without asking the user to select from the available options (this often causes issues for cases with one header plus many source files, or a .h/.inl/.cpp triple).
- Because it tries to be so smart, it might be heavy in terms of performance (as it looks through all the project symbols).
- Several heuristics exist which could be quicker and superior in many situations when switching between header/source. None of them is used by this general Go to Related Symbol action.
To address these issues, we’re introducing a new "Go to Header/Source" action:
As you can see, it either opens a file in the editor right away or shows the popup with various options. This action uses a few heuristics for the search:
- The most recent switched file is always at the top of the list.
- Next goes the file with the matching name from the same directory, if any (for example, myfile.h / myfile.cpp).
- Then, a definition/declaration-based search is performed in the background (which looks for files with definitions with matching declarations in the current file, and vice versa), and new items are added to the popup.
- Note that the search is currently limited to direct includers/includees so as to avoid interference from the same symbols from different targets.
- If no single destination is found within 500 ms, CLion shows an interactive popup where new items are added and you can select where you want to navigate to.
There’s one last thing worth mentioning. We understand that CLion users mostly use Go to Related Symbol as a Go to Header/Source action and might be accustomed to this shortcut. From now on, if you invoke Go to Related Symbol via the keyboard shortcut in a C/C++ file, and the non-default shortcut is not yet set for Go to Header/Source, CLion will ask you – only once per installation – if you’d like to remap the current shortcut from Go to Related Symbol to Go to Header/Source:
LLDB: read .lldbinit from the project root
You may find this useful to tune the LLDB debugger behavior via passing some commands and options in a .lldbinit file. Note that to enable this behavior, you have to explicitly allow it in your home .lldbinit file. Please see this for the exact commands.
Full release notes are here.
Your CLion Team
The Drive to Develop
Subscribe to Blog updates
CLion 2024.1 EAP 3: Assembly View Enhancements
Today, the CLion 2024.1 EAP 3 build (241.12662.59) is available from our website, via the Toolbox App, or as a snap package if you’re using Ubuntu. Here are the main improvements: Assembly view improvements: The Assembly view for ARM targets is now shown correctly (CPP-36901). Assembly vi…
CLion 2024.1 EAP 2: Improved Terminal and Other UX Enhancements
Some time ago, we shared our plans and directions. Just a couple of weeks ago, we kicked off our CLion 2024.1 EAP with CMake coding assistance, code analysis in device tree files, and forked processes debugging. Today, the CLion 2024.1 EAP 2 build (241.11761.23) is available from our website, via…
CLion Nova: AI Assistant and Enhancements From CLion Classic and ReSharper v2024.1
CLion Nova is a free preview of CLion equipped with the ReSharper C++/Rider C++ language engine. With this update, CLion Nova has finally moved to the 2024.1 branch. This means that all of the enhancements brought by the CLion Classic 2024.1 EAP are now available in CLion Nova: CMake writing ass…