010-68421378
sales@cogitosoft.com
Your location:Home>News Center >New release

WHAT'S NEW IN CLION

发布时间:2018/04/25 浏览量:1347
WHATS NEW IN CLION With this years first update, CLion 2018.1, you get enhanced C++17 support, new CMake actions, vario...

WHAT'S NEW IN CLION


With this year’s first update, CLion 2018.1, you get enhanced C++17 support, new CMake actions, various editor improvements, and a more responsive editor.
Windows users can benefit from support for Windows Subsystem for Linux, which makes it possible to compile, run, and debug Linux-compatible binaries while working on Windows, and even run them with Valgrind Memcheck.
WSL


 
Linux toolchain on Windows
If your project requires a Linux toolchain while being developed on Windows, you can now use Windows Subsystem for Linux (WSL) in CLion running on Windows.
Configure WSL and the corresponding toolchain under Settings | Build, Execution, Deployment | Toolchains, and then you’re ready to use it in CLion. Header search paths on WSL will be used, and the Linux binary will be created for you to run and debug on WSL.


 
Valgrind Memcheck on WSL

Valgrind Memcheck can detect dozens of memory errors and leaks and is now available for Windows users on WSL.
Turn on a WSL toolchain, make sure Valgrind is detected in settings (Settings | Build, Execution, Deployment | Valgrind), and then compile and run regular and test targets under Valgrind Memcheck to detect possible errors and leaks. View the results in a special tab in the Run tool window.


C++ support


 
C++17: If and switch with initializers

To avoid polluting an ambient scope or creating an artificial scope for initializers in if and switch operators, C++17 suggests adding an initializer to if and switchconditions. CLion now parses and resolves such statements correctly.


 
C++17: Structured bindings
C++17 introduced structured binding – a convenient and compact way of binding a list of identifiers to a set of objects. CLion’s C++ language engine now supports this feature and ensues accurate code analysis for it.


 
Ternary operator
The ternary operator is now handled correctly in CLion’s code analysis. This means many false warnings and errors are no longer thrown, such as:
•    Red code in the ternary + new operator
•    False positive if std::out is used in the ternary operator
•    Incorrect resolve when initializing a reference from a ternary operator


 
Rename and Change Signature for hierarchies
Refactoring hierarchies can be tricky, especially if you introduce a change in a derived function. To make it reliable we made sure that the Rename and Change Signature refactorings update functions in all inheritance branches, including sibling functions.

 

Clang-Tidy


 
Clang-Tidy options and configs
Now you can provide options to some Clang-Tidy checks (e.g. modernize-use-nullptr) in CLion, under Settings | Editor | Inspections | C/C++ | General | Clang-Tidy.
If you prefer .clang-tidy config files instead of the IDE-provided settings (for example, because you store these config files in a VCS for the whole team to access and use in various IDEs), you can configure CLion to respect your existing per-directory configs.

 

Editor


 
Code folding of the control statements

Now you can collapse/expand control statements (like if/else, do/while, for, or switch) with a code block that’s longer than one line, or with a code block inside braces. Just use Shift+Ctrl+Period / Ctrl+= You can also hover the mouse over the folded block to preview the content.


 
Message toolwindow: new settings

With v2018.1, you can decide if build output is always necessary (and thus should be visible) or it’s only needed if some warnings or errors appear. Look in the Messages tool window settings for these options:
•    Always Show on Build (Default)
•    Auto-Hide and Show on Warning/Error


 
Breadcrumbs for C and C++
Keep track of your location in C and C++ code with the breadcrumbs – small markers at the bottom of the editor that help you navigate around your code. Right now CLion shows namespaces, classes, structures, functions, and lambdas there.


 
Unwrap/remove code blocks
To accurately and safely remove enclosing parts in complicated code with lots of nested statements, use Unwrap/Remove… action (Ctrl+Shift+Delete). It suggests the options depending on where your caret is and is capable of unwrapping if, else, for, while, do..while and for control statements.


CMake


 


CMake Install
If you have any CMake install targets in your project, you can call Install from the CLion’s Run menu now. The cmake install command will be executed.

Alternatively, you can add an Install step to any of your run configurations in CLion.


 
Open single file and non-CMake projects
While CLion still requires a CMake project to provide smart IDE features, you can now open a single file or folder in CLion which don’t have to be connected to any CMake project.
Follow the built-in notification to select and load a CMakeLists.txt file later. Call Tools | CMake | Unload CMake at any time to unbind your project from the current CMakeLists.txt.

 


 
CMakeLists.txt file template
Create new file (Alt+Insert) now provides an option to create a CMakeLists.txt file.
The content of the generated file is defined by the template in Settings | Editor | File and Code Templates, so you can customize it based on your project’s or team’s needs.


Project scopes


 

 


Predefined and custom scopes
CLion 2018.1 brings several predefined scopes which can help overview your project from different angles, like Project Source Files, Project Non-Source Files, and Changed files.
You can also configure custom scopes, for example a scope that only includes project header files.


 
Project view
By default, Project View opens the Project, which includes all project files including the generated folder (like cmake-build-debug) and other excluded folders. Later, you can select between other predefined or custom scopes.


 
Find in Path
To narrow down your search and thus make it quicker and more efficient, use scopes in the Find in Path dialog. All custom scopes created earlier are available in the list.
VCS: Partial Git commits


 
Select code chunks to commit
Want to commit only the selected changes from files and leave others for later? Partial Git commits (git add -p) can help here, and now there is support for them provided by CLion here!
To include code chunks in a commit, use the check-boxes in the Diff pane of the Commit Changes dialog.


 
Move a change to the changelist
While editing a file, you can see change markers in the left gutter. These not only let you overview the change and roll it back, but also move it to any existing changelist or create a new one and add the current code chunk to it.


More languages – more power


Objective-C / Objective-C++ support
Work with files in Objective-C / Objective-C++ added to your CMake project and benefit from the following features bundled into CLion:
•    Language syntax support
•    Objective-C inspections (except for the clang analyzer set)
•    Key-value coding support
•    Live and file templates
•    Code style/color schemes


Fortran and Rust plugins
Fortran plugin comes with FORTRAN 77 / 90 / 95 / 2003 and 2008 support. The capabilities include smart editor, navigation actions, code analysis and debugger.
Rust plugin comes with:
•    the Cargo build system on board,
•    updates to CLion’s New Project wizard
•    and a debugger.


Other improvements


There are dozens of other useful enhancements in CLion 2018.1. 
•    Performance improvements: Important changes were introduced to make the editor more responsive. Incremental highlighting was implemented.
•    MSVC by default: No need to turn on Microsoft Visual C++ compiler support in Registry – now it works by default.
•    Color scheme improvements: CLion now bundles Monokai and GitHub schemes, and comes with lots of fixes to the existing schemes.

 

下一篇:QUARKXPRESS 上新装备啦!提高打印、数字设计新高度!(一)
上一篇:PSPDFKit最新亮点:智能选择、层叠注释、创建表单、API外部标签

© Copyright 2000-2023  COGITO SOFTWARE CO.,LTD. All rights reserved