CLion opens 2016.3 EAP: user-defined literals, CMake output, C11 keywords completion and more

Hi everyone,

While we are still working on some changes in 2016.2 version and even backporting some compatibility fixes to 2016.1, this week we are also excited to announce the start of the Early Access Preview for CLion 2016.3, the third major update coming later this year. We have huge plans and are going to start right now with many new exciting features!

Download CLion 2016.3 EAP build 163.3983.6, give it a spin, and share your feedback with us in the comments section below and in our tracker – no active subscription required!


Download CLion 2016.3 EAP

In addition to various bug fixes, this build includes:

User-defined literals

User-defined literals (UDL) is a C++11 feature that brings the concept of built-in type into the language, allowing developers to define types out of integer, float, character, and string literals by adding special suffixes. This makes the code easier to read. The Standard Library uses user-defined literals in a few places like std:string, std::complex, and std::chrono.

So please welcome UDL support in CLion! Use STL literals or define your own and be sure no more false positive errors are shown in the editor:
udl_lexer

Not only does CLion parse the user-defined literal, but it understands its type, as displayed in the Quick Documentation popup (Ctrl+Q on Lin/Win, F1 on macOS):
udl_quick_doc

We plan to add a couple of smart actions for working with user-defined literals, including a quick-fix that generates a missing operator"" (CPP-7538) as well as Rename (CPP-7453) and Inline (CPP-7540) refactorings. Share your comments in the corresponding tickets and upvote and follow them to get updates.

C11 keywords

CLion 2016.2.2 added support for some C11 keywords including _Thread_local, _Alignas, _Noreturn, _Static_assert, and _Atomic. CLion 2016.3 EAP expands this by adding _Generic keyword to the list, as well as providing code completion for C99 and C11 keywords:
c11_completion

Code generation attributes

The behavior of Override (Ctrl+O) and Implement (Ctrl+I) actions has been updated to use the virtual keyword by default when needed. The override attribute can be selected as an option:
override_implement
This helps avoid situations when both attributes are added automatically (CPP-416).

CMake output

CMake tool window provides information on CMake warnings and errors (Problems tab) and CMake Cache variables (Cache tab). CLion 2016.3 EAP adds a new tab that contains CMake command output.

The tab provides several output logs, one per each CMake configuration. It can be used to track the progress and debug CMake scripts by checking the output messages from CMake.

When debugging CMake scripts, here’s one of the possible supported workflows:

  1. Run CMake reload.
  2. Check errors in the Problems tab.
  3. If an error is caught and the reason is unclear, navigate to the Output tab.
  4. Try to guess the problem source, make a fix, and re-run.

cmake_output_navigate

Previously CLion had debugging problems with projects whose paths included symlinks. Now it handles such projects correctly, especially adding and stopping at breakpoints in project and library files. If you face any issues at all with such projects, feel free to share with us.

Semantic highlighting

Some say developers spend most of their time reading code rather than writing it. Reading code is not the same as reading a book. Code is usually well-structured, and while reading it we pay attention to a selected set of primitives and structural elements. This makes it easier to understand the idea (the algorithm) behind the code.

Usual highlighting picks out language keywords, types and values. However, if you’d like to understand how data flow through the code, it makes sense to highlight each variable/parameter with its own color. That’s where semantic highlighting comes in.

CLion 2016.3 EAP comes with a possibility to switch on semantic highlighting in the editor:

  1. Go to settings Editor | Color & Fonts | Language Defaults.
  2. Go to Semantic highlighting settings and select the option Unique color for each parameter and local variable.
  3. Now you can configure start/stop points for the gradient. Variables colors will be distributed uniformly between these points.

semantic_settings

CLion follows these simple rules with its semantic highlighting:

  1. Each parameter and local variable has its own color.
  2. CLion tries to keep colors unique inside the body of a function or lambda.
  3. Identifiers with the same name are assigned the same colors.

Try semantic highlighting in CLion today and let us know what you think!
rainbow

Command-Line Source Code Formatter

Starting from this build, CLion comes with a command-line source code formatter (and so do IntelliJ IDEA and other IntelliJ-based IDEs). It can be used to format a set of selected files outside a project scope using an XML file with the exported code style settings. It’s available on Linux and Windows for now (macOS will join next EAP).

It can be used to format all files in a directory, or only those matching a list of file masks, or just a single file. Script should be provided with the code styles settings file in the XML format. The default code style is used if the file is omitted:
format_dir

To export code style settings, go to settings Editor | Code Style, click Manage… and export the code style you prefer to XML. This file can then be provided as a parameter to the format script.

Version Control improvements

Undo

With the new version, you can safely undo certain actions with no harm to your project. First, undo the last change that you haven’t pushed yet via the Log’s context menu:
undo_commit_framed

Second, restore a deleted local branch (or alternatively delete the tracked remote branch too).

Sign-off commit

Some projects require Git –signoff commits to be used (most popular use case is getting patches into the Linux kernel). It simply adds a line at the end of the commit message, which certifies the commit author and can be interpreted as a chain of responsibility for the copyright status of the code. You can now find this option in CLion’s commit dialog:
sign_off

User interface

Find in Path

By popular request, we’ve changed the behavior of Find in Path so that it now preserves used previously settings, regardless of where you call it from:
find_in_path

San Francisco font for macOS

macOS users will notice that the default UI font is now San Francisco (SF NS Text). As the new standard for the macOS, it’s used across all the menus and tool windows both in the Default and Darcula themes:
san_fr

Also, we are happy to share that the native file chooser on macOS is now back. Sorry for any inconvenience before!

Fira Code font

CLion 2016.2 brought support for font ligatures. Now we are happy to announce that CLion 2016.3 EAP bundles the FiraCode font that supports ligatures, so you don’t need to install it manually. To set is as your editor font, select it in settings Editor | Colors & Fonts | Font.

That wraps it up! The full release notes can be found here.


Download CLion 2016.3 EAP

Your CLion Team

JetBrains
The Drive to Develop

This entry was posted in Announcement, Early Access Preview and tagged , , , , , . Bookmark the permalink.

39 Responses to CLion opens 2016.3 EAP: user-defined literals, CMake output, C11 keywords completion and more

  1. Marcus says:

    User defined literals works a treat for me – it’s such a nice feeling to see more of those false positives go away with each release! – I’m pretty impressed that it’s such a comprehensive implementation too (handling concatenated strings etc) – nice job!

    I must say also that I’m a real fan of ligatures – the only time that it does something unexpected is when I use “////////////////////////” or “// ———————–” to split up code blocks (but this is very minor!!) – A very nice feature!

    Many thanks for all your hard work!

    Regards,
    Marcus.

    • Anastasia Kazakova says:

      Thank you Markus for your support! We really appreciate it. And we’ll continue with improving the parser further.

  2. Tom Kulaga says:

    hi,

    Is there any news on the high CPU usage issues?

  3. Danylo Bilyk says:

    Ninja support?

  4. andrew somerville says:

    No release notes this time? (or am I just missing them somehow?)

    https://confluence.jetbrains.com/display/CLION/Release+notes

  5. David Zemon says:

    This is an excellent release! Lots of great features here.

    In particular, I’m enjoying semantic highlighting a lot. I could see where some people might get too distracted, but I love it. I was quite surprised this feature wasn’t implemented in the IntelliJ core codebase though; I expected to see it in the IDEA 2016.3 EAP release too but don’t. Will be ported to IDEA soon?

    Thank you!
    David

    • Anastasia Kazakova says:

      Thanks David!

      Semantic highlighting is language specific feature, so each team implements it individually. There is some platform code that is already there. But now each product needs to adopt it, when the team has time and resources. Most likely IntelliJ IDEA team will do, but a bit later.

      • Christian Fischer says:

        Semantic highlighting looks very useful for examining foreign source code. But when writing my own source code, it looks a bit messy to me.
        How about adding a menu entry or key binding for quickly enable or disable semantic highlighting without the need to change the color scheme?

  6. Mikhail says:

    Thank you very much for ‘CMake output’ and ‘bundled FiraCode’. The only missing thing is now ‘remote debugging from Windows to Linux’.

    • Anastasia Kazakova says:

      Thanks you for your support! Windows-based remote debugging is in development. We really hope to have it done for 2016.3 release.

  7. Olof says:

    For Firacode to work one needs to unclick show only monospaced fonts. That took a bit of figuring out.

  8. Alexander Münch says:

    Today I tried the semantic highlighting in IntelliJ (nice that your IDEs share a common code base so a feature announced in CLion could be in IntelliJ, too – even when not yet announced :-)).
    I wanted to share my first impressions with you.

    First of all: The semantic coloring is an extremly useful feature! Thanks.

    A common use case: Particularly in unit tests there is much identical code (instantiate var1, call multiple setters on it, instantiate var2, call setters with other values… maybe a var3, var4, …). Before I had to work with Ctrl+Shift+F7 to highlight each variable one by one to check there is no copy&paste error on the numbers/variable names.
    Semantic highlighting does this so one look on the code is enough to see whether there are wrong colors somewhere, i.e. a wrong variable.

    The default colors (in IntelliJ; don’t know whether Clion uses other gradient colors) work pretty much. However I find it difficult to tell strings (green) and locals/parameters (a little different green in the gradient) apart.
    Also I noticed the blue gradient color stop leads to very dark colors that can be mistaken by gray. And gray means an unused variable.
    Difficult to make a suggestion here how you can improve. Keep these two difficulties in mind and look critically at the colors. May be you can find different default color stops or maybe a little magic the IDE does not get too close to another color already assigned.

    Keep up the good work
    …and give your IntelliJ colleagues a hand with IDEA-160904 😉

  9. Nate says:

    September 5th 2016.2 build and current EAP have become unusable on our code base. It typically does not finish indexing and spends obscene amounts of time with the GUI unresponsive. I don’t know how to be more specific than that. Is this a known issue or should I try to collect some information for you?

  10. kaiser says:

    The last two EAPs hang (or freeze) soon after startup on MacOS Sierra, even after deleting all settings. They are unusable for me.

  11. Pier says:

    When is the official 2012.3 scheduled to be released?

  12. Jame says:

    It’s great that CLion includes Python support!
    Another blog post says the features are approximately equivalent of PyCharm community edition. Now let’s say you have a license for PyCharm (and CLion). It would be really nice to get some of the Pro features of PyCharm in CLion as well, like the Profiler mainly! Could you support that in the future? Otherwise you have to switch back to PyCharm just to use the profiler, which is quite a hassle :-(

  13. RiaD says:

    Are there plans to fix settings repository in 16.3 ? https://youtrack.jetbrains.com/issue/IDEA-161728

    I know it’s technically not your project but it’s real stopper for me

    • Anastasia Kazakova says:

      We are still considering the fix. Can’t promise anything particular for now. But thanks for reminder, will check the state.

  14. Sebastian Hofstetter says:

    Great release!

    (1) I like the new cmake build_type design. However: Please, please add a drop down menu next to the targets for selecting the build_type (like in Visual Studio) and don’t make us go into the preferences every time we want to switch between releasedebug mode. Also: It’s strange that now we have to change the build_type both in the preferences and in the target configuration (which doesn’t find the old build type anymore after changing the cmake preferences).

    (2) Any news on the assembly view?

    • Anastasia Kazakova says:

      Thanks for the feedback!

      As for the assembly view – we are still not on it, most likely will be added later.

Leave a Reply to Christian Fischer Cancel reply

Your email address will not be published. Required fields are marked *