📜 ⬆️ ⬇️

CLion 1.2: even more features and benefits

Today we want to tell about the new release of our cross-platform IDE for C and C ++ - CLion 1.2. This release was released just the other day, as part of the update of all desktop products JetBrains and the launch of a new licensed model .



By the way, if you already have a CLion license (purchased before November 2 or after launching a new licensed model), you receive this update absolutely free. So what's inside?
')

Google test


One of the main innovations of this release is Google Test support and the ability to run tests directly from the IDE. To do this, CLion implements special configurations that are created automatically when you run a test, test file, test class, or manually in the settings. In the configuration settings, it is indicated which tests to run, which target to call and so on:



The test can be started directly via the context menu or by using the keyboard shortcut ( Ctrl+Shift+F10 on Windows / Linux, Ctrl-Shift-R on OS X). The result of the launch will be displayed in a special window:



The interface is probably familiar to those who have used / used other products based on our IntelliJ platform. From this window you can:


To facilitate the writing of tests directly, we added code generation:



The menu appears by pressing Alt+Insert on Windows / Linux, Cmd-N on OS X, and offers to generate one test, a test class (fixture) and a standard pair of SetUp / TearDown methods. At the same time, the generation of the test method itself is tricky - first, the TEST () macro is always created, and then, depending on the context, it is automatically replaced with a more suitable one. For example, when specifying the name of an existing fixture, the macro is automatically replaced with TEST_F ():



You can read and watch more details about Google Test in CLion 1.2 in our English-language blog and in the corresponding video on the YouTube channel .

C ++ Support Improvements


This release includes more than 50 fixes related to the C ++ language. For example, support for the macro __LINE__ , required for development under the Unreal Engine 4 and not only. (By the way, about getting a CMake project for working with UE4 in CLion, read an article in English from our colleague).

Our IDEs are known for their ability to infer types, and with the advent of C ++ 11, this has also been true for C ++. The point is that it is not always easy to determine the type of a variable declared as auto ; you need to study carefully and for a long time what kind of call assigns a value to a variable. The IDE comes to the rescue here - the Quick Documentation popup window shows the type you want. The new version of CLion 1.2 fixes several problems with the output of these types:



Continuing to work on templates, we implemented a search for uses and renaming refactoring for template parameters. And in case the parameter is not used in any way, the IDE added the option of smart deletion (quick-fix) of a parameter from the definition and use of the template:



CMake


To make it easier to write CMake files, CLion 1.2 has two options:

We added a few pre-made templates: foreach , function , if , macro , while , incboost (which helps connect the Boost libraries to the project). You can also create your own and use them in CMake files. As for other similar templates, for abbreviations of templates there is autocompletion, and the template is revealed by pressing the Tab key (or another one configured in the settings):



In previous versions, CMake commands autocompletion was already present, and now we have implemented autocomplete variables (so far only those with static names).

There is also an option in the formatting settings that allows you to always use only uppercase letters or always only lowercase letters for CMake commands (valid and a variant of the mixed style).

Debugger


The main changes in the built-in debugger are work on performance. We made a lot of changes that markedly improved the situation (but we still have where to go). Such, for example, as “lazy” creation of variables for GDB.

There have also been several changes to the rendering of references type variables and Unicode character arrays:



Platform Changes


Like other IDEs on the IntelliJ platform, CLion received a number of general improvements:


At the end of a small demo (in English):



Follow the posts in our English-language blog and read more about the capabilities of the new version of CLion 1.2 on the site . As usual, there is a 30-day free trial, and in the price section you can find out about the cost of a new model and licensing options. We are happy to answer any of your questions in the comments.

Program with pleasure!
Your JetBrains CLion Team

Source: https://habr.com/ru/post/270185/


All Articles