CLion 2019.1

Released: Mar 27, 2019

Updates in 2019.1

Features

Embedded Development

  • STM32CubeMX integration - If you develop for STMicroelectronics boards, you’ll be happy to know that CLion now integrates with STM32CubeMX:
    • CLion can create a new .ioc project or open an existing one, and generate a CMake file to correctly work with it.
    • You can start STM32CubeMX any time directly from CLion to update board settings and generate code.
    • CLion reminds you to select a board config and suggests a list of options in the UI.
  • OpenOCD support - Debugging with the Open On-Chip Debugger is now supported by CLion. Use the new Run/Debug configuration template, ‘OpenOCD Download and Run’ to debug on your microcontroller.

ClangFormat

  • The ClangFormat tool is widely used in the C/C++ world and even regarded as a standard by many developers. Its config files can be found in many projects, and especially in open source software. And it’s now supported in CLion.
  • ClangFormat across all IDE actions - CLion 2019.1 adds ClangFormat as an alternative code formatter. Turn it on for your current project or all projects in CLion and let CLion use it to format your code as you:
    • Type in the editor or paste code
    • Call the Reformat Code action
    • Reformat as a pre-commit hook
    • Generate boilerplate code
    • Refactor code
    • Apply quick-fixes or intention actions
  • Working with .clang-format config - CLion detects .clang-format config files in your project and will suggest switching to ClangFormat. If there are multiple config files, you can identify which one is used in a particular file opened in the editor by selecting “View ClangFormat options for <file name>” from the toolbar switcher.

Naming conventions

  • Setting naming in CLion - CLion now respects the naming scheme you provide. The selected settings will be used when:
    • Autocompleting code
    • Generating code
    • Refactoring code
    • Applying quick-fixes
  • Inconsistent naming inspection - CLion can help enforce the selected naming convention in the editor. Simply turn on the Inconsistent Naming inspection, and CLion will highlight problematic names and suggest a quick-fix to replace all usages with a more accurate name.
  • Header Guard style - In Settings | Editor | Code Style | C/C++ | Naming Convention, you can configure the style for Header Guards to be used when creating a new header file.

C++ support

  • Code highlighting and quick-fixes with Clangd - To improve the editor performance, code highlighting and quick-fixes are now implemented on top of the complementary Clangd-based language engine (and are enabled by default along with the engine).
  • Error messages powered by Clang - In v2019.1, CLion gets improved and more detailed error messages powered by Clang.
  • Improved Rename refactoring
    • When you do a file rename, CLion asks if you’d like to also rename an associated class/struct, and the other way around.
    • When the header file is renamed, the header guards are updated accordingly.
  • Improved Extract refactoring - The Extract refactoring is now more accurate and:
    • Respects type aliases and doesn’t expand on static members
    • Respects std:: namespace qualifier
    • Respects template specialization and template parameters
  • Member function can be static - This new inspection reports member functions that can be marked as static. It works on top of the Clangd-based language engine and analyzes the method body, trying to check if it depends on this or not.

Debugger

  • Disassembly View - Disassembly View is now available for LLDB in addition to GDB backend. CLion also improves the view in general so that now it shows information divided by function.
  • Mute Variables - To get a better stepping performance, or if you need to watch the variables only occasionally, you can now explicitly Mute Variables. A general per-IDE switch will stop the variable calculation, and each variable in the variables view gets a Load option which you can apply as needed.
  • Memory View - Memory View dumps the memory behind the pointer in the Debug mode. To invoke it, select a pointer variable in the debugger’s variables view and press Ctrl+Enter.

Custom Build and Run

  • Custom Build Targets - Build-system independent Build Targets (Settings | Build, Execution, Deployment | Custom Build Targets) allow you to add custom targets and configure any tools to be used for Building/Cleaning the target.
  • Custom Run/Debug Configurations - To run and debug Custom Targets from CLion, create a corresponding Run/Debug configuration by using the Custom Build Application template (Run | Edit Configurations…).
  • Injected languages - String literals with pieces of code in other languages can now be treated accordingly. To temporarily inject a language, press Alt+Enter, apply the intention “Inject language or reference”, and select the appropriate language. For example, SQL strings, HTML code, or Regular Expressions.

Custom color themes

  • Brighten up Your IDE - Tired of Black and White themes in CLion? Tweak literally every color in your IDE, from icons to radio buttons and arrows.

Recent locations

  • The Recent Locations Popup (Shift+Ctrl+E) lists all the locations that you’ve visited in a chronological order so that you can easily go back and find things.

Other improvements

  • The process of building CLion’s plugins was simplified by publishing CLion as a Maven dependency to be used by gradle-intellij-plugin (since version 0.4.2).
  • The bundled CMake is updated to 3.13, the bundled LLDB is updated to 7.0.1, and the latest supported Cygwin is now 3.0.
  • IPv6 is now supported to help you use Remote Development mode in CLion.
  • The Rust plugin received a massive update: it suggests out-of-scope items in completion and auto-import, as well as supports Rust language injection into code snippets in doc comments. Besides, profiler tools (like DTrace or Perf) are now supported for Rust.