Early Access Program News

From C/C++ to native development: Rust and Fortran plugins in CLion

While CLion’s main focus is on C and C++, it also provides extensive support for other languages that supplement the C/C++ ecosystem:

  • Python (interesting fact: according to feature usage statistics, Python is used in 30% of projects opened in CLion!)
  • JavaScript, HTML, and other web technologies
  • Objective-C / Objective-C++ as supported for the first time in CLion 2018.1 EAP

Support for these languages is included in CLion by default, along with C and C++.

We also offer multiple plugins that expand CLion’s focus and make it a viable IDE for native development. We’ve recently announced support for Kotlin/Native, our technology that compiles Kotlin directly to machine code and produces executables that can run without a virtual machine.

Today, we are happy to tell you about two new language plugins that can be installed on top of your CLion (the latest improvements are available in 2018.1 EAP):

Both plugins are on their early stage of development, so issues are possible and some functionality might be missing. Your feedback and bug reports are welcome (feedback on the Fortran plugin, feedback on the Rust plugin).

Fortran

GNU Fortran compiler is provided as part of the GCC installation. The Fortran plugin is compatible with all IntelliJ-based IDEs. However, to work with Fortran project in CLion, you need to have a CMake-based project. Find a sample Fortran project build with CMake in this wiki.

The plugin supports FORTRAN 77, FORTRAN 90, FORTRAN 95, FORTRAN 2003, and FORTRAN 2008 source code. It parses Fortran code and highlights it for you. In addition, it offers many smart actions:

  • For editing code:
    • Code formatting (available for free source form files only for now)
      fortran_format
    • Add a line comment (Ctrl+Slash for Windows/Linux, ⌘/ on macOS)
    • Code folding
    • Brace matching
  • For navigation:
    • Find Usages
      fortran_usages
    • Go to Definition
    • Structure view
  • For analyzing code, a set of useful code inspections to catch potential errors:
    fortran_inspections
  • A debugger (switch to GDB in CLion):
    fortran_debugger

Rust

Like the Fortran plugin, the Rust plugin is also compatible with all IntelliJ-based IDEs. However, as we’ve already mentioned in our company blog, the debugging feature is available only in CLion for now.

If you’ve already tried the Rust plugin in CLion, your next question may be, Does it work without CMake? Well, now the answer is a resounding Yes! The Rust plugin for CLion comes with Cargo support on board!

To start a new project, use the New Project wizard, select Rust, and provide paths to the toolchain and standard library. CLion will do its best to detect it automatically if you already have it installed on your machine; the standard library can be downloaded via rustup right from the wizard:
rust_new_prj
A new Cargo project will be created for you by CLion.

To learn more about how to get Rust, configure CLion, and start a new project or work with an existing one, check out the IntelliJ Rust Quick Start Guide.

The plugin’s capabilities include:

  • plenty of smart editing features,
  • on-the-fly code analysis:
    rust_analysis
  • lots of navigation actions (like Find Usage, Go to Class, Go to Super, a File Structure view, and others),
  • options for code generation and some important refactorings,
  • Quick Documentation popup (including documentation for library functions):
    rust_quick_doc
  • and even more.

Find more details about all of the plugin’s features on its site.

Now, if you are using the Rust plugin in CLion, you can debug your Rust application right from the IDE!
Rust Debug

So, get the latest CLion 2018.1 EAP, check out one or both plugins from the plugin repository (you can do this right from the IDE in Settings/Preferences | Plugins | Browse repositories…), and enjoy!

Your CLion Team
JetBrains
The Drive to Develop

image description

Discover more