CLion 2018.1 is released: more C++17, WSL, CMake Install, new languages supported, and much more!
Please welcome the first big update this year, CLion 2018.1! It’s packed with various enhancements and cool new features for C/C++ developers on all platforms, and especially on Windows, plus a range of benefits for those who use C/C++, Objective-C / Objective-C++, Rust, and Fortran.
Read on for more details and get your free 30-day trial to evaluate all the new features and enhancements:
- Better C++ support: C++17
switchwith initializers, C++17 structured bindings, and some more.
- Clang-Tidy with options and .clang-tidy config support.
- Windows Subsystem for Linux (WSL) support: compile, run, debug, and run with Valgrind Memcheck.
- CMake: Install action, open non-CMake project in the editor, and templates.
- Editor enhancements: from code foldings to breadcrumbs and project scopes.
- VCS: partial Git commits.
- New languages: Objective-C / Objective-C++, Rust, and Fortran.
For a quick overview of the new features and enhancements, watch this video from Phil Nash:
C++ support: more C++17
We’ve been focusing on C++ a lot. We’re working in several directions that may lead to better language support in the long run, including both accuracy and performance. We’re considering some alternatives to the current language engine in CLion, and have already run some experiments (expect some results in 2018.x versions). Nonetheless, the current implementation is still our main area of focus, and v2018.1 offers some major improvements like:
- Support for C++17 structured bindings
- Support for C++17
- Proper support for ternary operator
- Reliable refactorings (Rename and Change Signature) for hierarchies:
Besides, the editor is now more responsive thanks to incremental highlighting and principal changes to typing handlers.
Clang-Tidy: more flexibility, more control
Clang-Tidy is a powerful tool which complements CLion’s own code analyzer. In this release, we’ve given it more control.
First, you can now provide options required for some checks like modernize-use-nullptr. Second, you can ask CLion to use .clang-tidy config files instead of the IDE-provided settings. This means your whole team can use the same Clang-Tidy’s set of check, regardless of the variety of IDEs and text editors that different team member are using. To do all this, go to Settings/Preferences | Editor | Inspections | C/C++ | General | Clang-Tidy:
We’ve also updated the bundled version of Clang-Tidy and optimized the set of checks turned on by default.
WSL: Linux binaries on Windows
In this release, support for Microsoft Visual C++ Compiler is turned on by default (no need to turn it on in the Registry now), so you can use it easily if you have it installed on your machine. We’ve also expanded the number of toolchains supported on Windows by adding WSL support.
WSL makes it possible to compile, run, and debug Linux binaries while working on your Windows 10 machine. Multiple Linux distributions are supported, so you can pick your preferred one. Simply start WSL on your Windows machine and connect to the toolchain from CLion. CLion will use CMake, make, GCC/G++ compilers and debugger from WSL, and will build and run your binary there.
Besides, WSL toolchain support comes with Valgrind Memcheck, which is now available to Windows users in this way:
To learn how to install WSL and configure it for CLion, please refer to this blog post.
WSL is a first step to full remote support in CLion, which is why it was implemented via SSH. You can expect further remote development features in the upcoming 2018.x releases.
CMake: Install & non-CMake projects
As promised, we’ve started the process of decoupling CMake project model from CLion. The first results are already here – you can now open a single file or folder (w/o CMake) in CLion. CLion still requires a CMake project to provide smart IDE features, but in case you just want to read some C++ code in CLion, it should be enough.
We’ve also continued to work on CMake integration in CLion, and are happy to introduce the CMake Install action in the editor. Use it from the Run menu, or add an Install step to any of your run configurations in CLion:
And finally, ‘Create new file’ (
Alt+Insert) now gives you an option to create a CMakeLists.txt file. The content of the generated file is defined by the template in Settings/Preferences | Editor | File and Code Templates, so you can customize it based on your project’s or team’s needs.
Editor: more actions, better navigation & project scopes
We use CLion to code in C++ on our own, some of the time, and this helps us implement some tiny but nice additions to the editor. We find them useful and we hope you’ll like them too:
- Breadcrumbs for C/C++: These small markers at the bottom of the editor help you navigate around your code. Showing namespaces, classes, structures, functions, and lambdas, they make reading and navigating through the code much easier:
- Unwrap/remove code blocks: This is yet another IntelliJ Platform feature that has been implemented for C/C++. It safely unwraps
forcontrol statements, or just accurately removes enclosing parts of nested statements:
- Code folding of the control statement: This was one of the top-voted requests from our users. Use
Ctrl+=(on Windows/Linux) or
⌘+(on macOS) to collapse/expand control statements (like
switch) with a multiline code block, or with a code block inside braces.
- Message toolwindow settings: These extra settings allow you to configure if build output is always necessary (and thus should be visible) or only needed if some warnings or errors appear.
Another thing worth mentioning here is Project Scopes. With many predefined scopes (Project Source Files, Project Non-Source Files, and Changed files) and an ability to create custom scopes, you get a chance to look at the project at different angles in Project View, and filter results easily in Find in Path.
VCS: partial Git commits
Partial Git commits (git add -p) are helpful when you want to commit some particular changes in your project to the version control system while leaving other changes for later. CLion now supports this in the UI. While committing changes, select which code chunks to commit and tick them off in the Diff pane of the Commit Changes dialog. You can also move changes between changelists right from the editor, using change markers in the left gutter. Learn more in the IntelliJ IDEA blog.
Beyond C++: Rust, Fortran, Objective-C/C++
CLion 2018.1 comes with bundled support for Objective-C and Objective-C++. Check out exactly what is supported.
Besides, plugins for Rust and Fortran are available and have been updated. Rust comes with Cargo build system support (thanks to decoupling CMake from CLion!) and the debugger. Fortran works via CMake and supports FORTRAN 77, Fortran 90, Fortran 95, Fortran 2003, and Fortran 2008 source code. Read more about these plugins in this blog post.
Sound impressive yet? Explore all the new features in even more detail on our website. Start your 30-day free evaluation and try out all these new features and fixes!
Your CLion Team
The Drive to Develop
Subscribe to Blog updates
Thanks, we've got you!