CLion 2020.3

改进了单元测试、代码分析、运行和调试应用程序。
12月 3, 2020
新版本

特性

Debugger

  • Debug as Root - CLion 2020.3 can run and debug your application with root privileges – you just need to select this option in the corresponding Run/Debug configuration. This works for CMake, Makefile, Gradle Native, Custom Build, and CTest applications.
  • Debugging with Core Dumps - New Open Core Dump action available for Linux and Apple macOS allows you to open an existing core dump of a crashed process in CLion and debug it there. Users can inspect the frames and variables view, check the memory and disassembly view, evaluate expressions, and run debugger commands from the debugger console.
  • Set Execution Point - With a new Set Execution Point to Cursor action, you can move back and forth though your program’s execution while debugging, break loops or restart them, select another branch in an if-else clause or switch-case statement, and even skip loops completely. It is as simple as dragging-and-dropping an arrow in the gutter to the line you are interested in.
  • Interactive hints and Inline watches - Now when the application is running in debug mode, the editor displays clickable inline hints that you can expand to see all the fields belonging to a given variable. Moreover, you can change the variable values inside the drop-down list or add an arbitrary expression as an Inline Watch to this place in the code.

Run Settings

  • Configure environment with a script - You can now use a script to specify the environment in which a Run/Debug configuration will be launched. You'll find the new setting for this in all Application and Unit Testing configurations.
  • Edit configurations while indexing - Run/Debug configurations can now be edited while the project is being indexed.

Unit testing

  • CTest support - CTest, a CMake-specific test runner, is now supported in CLion. This means the list of tests that are run with CTest is detected, and the IDE automatically creates run/debug configurations for them. When tests are launched, the results are presented in the built-in test runner, from which you can debug tests, rerun only failed tests, and much more.
  • Test runner for Google Test - Version 2020.3 enhances CLion’s support for Google Test. Updates included:
    • The full test tree is displayed immediately in the built-in test runner, and then the tests are executed.
    • For parameterized tests, CLion now displays test parameters right in the test tree.
    • Disabled tests (those with the DISABLED prefix in their names) are now also shown in the test tree with the corresponding icon.

Code analysis and refactoring

  • MISRA C and C++ - CLion 2020.3 brings partial support for MISRA C 2012 and MISRA C++ 2008, guidelines used widely in embedded development and especially in the automotive industry. This support speeds up the development of such projects by revealing incompatibilities earlier in the development cycle. The list of currently supported checks is available on CLion’s Confluence page.
  • Unused value - CLion 2020.3 improves the Unused Value inspection, which catches situations where a variable value is never used after it has been assigned. It can now also be tuned to follow the style that recommends using default variable initializers. A new option to turn the inspection off in such cases has been added to the settings.
  • Extract Lambda Parameter - A new Extract Lambda Parameter refactoring has been added to CLion. It extracts an expression or statement into a new parameter with a lambda expression passed as a corresponding argument. The statement could, for example, be a comparator passed to a sorting function.

Code completion

  • Clang completion snippets - Clang completion snippets help you insert common constructs when C++ keywords are typed. In some cases, when completing a typedef keyword, for example, code completion can suggest not only the keyword itself but also stubs for the type and the new name.
  • Completion for templates - CLion 2020.3 improves code completion, as it now works much more accurately with template types.

Qt projects

  • Create a new Qt project - The New Project dialog suggests the Qt Console Executable and Qt Widgets Executable project types. You can also select the Qt CMake prefix path, the C++ language standard to be used in the project, and the Qt version. The new project is generated using the corresponding templates.
  • Create a new Qt UI Class - A new QT UI Class item in the New menu (Alt+Insert) helps you simultaneously create a Qt class along with a .ui file. Fill in the class name and select the parent class (QWidget, QMainWindow, or QDialog). .h/.cpp/.ui files will be generated using the Filename base as their file names. The generated files follow the templates: Qt Class, Qt Class Header, and Qt Designer Form.
  • Complete signals and slots - Signals and slots are central features of Qt, as they are the entities used for communication between objects. CLion now understands when signals or slots have to be completed, and it filters only the corresponding members in the completion dropdown.
  • Auto-import in Qt style - Auto-import suggestions in Qt projects in CLion 2020.3 are tuned to follow the most commonly used style for Qt.

Makefile projects

  • Support for projects using libtool, dolt, and ccache - Makefile projects using various wrappers like ccache, libtool, dolt, slibtool, and jlibtool can now be successfully loaded in CLion.
  • Run/Debug configurations - Setting up a Makefile project in CLion is now even easier – the Run/Debug configurations are created automatically for the targets in the top-level Makefile when loading the project. Now to run and debug, you just need to point the configuration to the built executable.
  • Recompile single file - The Recompile action (Ctrl+Shift+F9) helps speed up the development process by compiling a single file without building the whole project. It now works for Makefile projects, too.

CMake

  • Enable/Disable CMake Profiles - With CLion 2020.3, it’s now possible to keep several CMake profiles configured in CLion while disabling the ones that are not currently in use. This improves the project loading times and saves from the redundant failures from temporarily unavailable profiles (like for the remote configurations which are currently shut down). The option is available from the CMake tool window and the CMake Profiles settings dialog.

VCS

  • Git tab in Search Everywhere - The Search Everywhere dialog now includes a Git tab. It helps with finding commit hashes and messages, tags, and branches. You can also perform simple mathematical calculations in the search field.
  • UI updates - The VCS menu is now named according to the version control system in use. This release has made the menu more concise, removing all but the most useful actions for versioning your project. Additionally, now the two most popular buttons, Commit and Commit and Push, are explicitly shown on the Commit screen.
  • Git staging support - You can now stage changes directly from CLion. You can also stage changes right from the gutter or in the Diff view.

Remote development

  • Automatic update of Exclude paths - Directories marked as Excluded locally are now automatically marked as Excluded paths for remote toolchains when they are initially being configured. And when changes are made to an already synchronized project, CLion shows an update notification and suggests updating the list of Excluded paths.

Code With Me

  • CLion 2020.3 supports Code With Me (EAP) - A new service from JetBrains for collaborative development and pair programming. Code With Me enables you to share the project you currently have open in your IDE with others, and work on it together in real time.

UI update

  • Updates to Welcome screen - CLion 2020.3 gets a revamped Welcome screen. The new layout puts the most common operations at your fingertips and gives you immediate access to recent projects, customization options, and plugin settings.
  • Splitting an editor - It’s now possible to split an editor by dragging and dropping a tab to the side of the main editor window. The Open in Right Split action splits the editor vertically upon opening a file. You can invoke the action from the Project view or from other navigation popups, such as Recent Files and Search Everywhere (Shift+Enter).
  • IDE theme synced with OS settings - CLion can now synchronize with your OS theme.
  • Rust plugin update - IntelliJ Rust now fully supports Cargo features and allows you to configure them with a smart new UI. Features of a workspace can be toggled on and off with a single click, and the plugin’s code assistance will take these settings into account.
    • The plugin also now allows using Rustfmt as the default code formatter.
    • The plugin’s project wizard has been enhanced with more templates and the option to use custom cargo-generate templates.
    • Other updates include the introduction of WebAssembly project support and a new experimental engine for name resolution.
Improves Unused Value inspection

CLion

用于 C 和 C++ 的跨平台 IDE。

有任何疑问吗?

透过Live Chat与我们的JetBrains 专家联络!