Clion Intellij

Let's say you have two directories, impala-be and impala-fe, for CLion and IntelliJ respectively. You can make C/Python changes in CLion, and Java changes in IntelliJ. After you make some changes, use git-diff to generate a patch, e.g. Use 'git diff be-tmp.patch' in impala-be dir. CLion 2020.1.2 plugin 1.24.1 Last Action: WelcomeScreen.OpenProject com.intellij.diagnostic.PluginException: While loading class io.github.intellij.dlanguage.module. When comparing CLion vs IntelliJ Rust, the Slant community recommends IntelliJ Rust for most people.In the question“What are the best editors/IDEs for Rust?”IntelliJ Rust is ranked 1st while CLion is ranked 8th. There are two approaches to adding new debugger integrations in CLion. Using the IntelliJ API The official way for all IntelliJ-based IDEs is to: implement com.intellij.xdebugger.XDebugProcess together with the necessary com.intellij.execution.runners.ProgramRunner for the 'Debug' action to pick up your debugger.

  1. Clion Intellij Vs
  2. Clion Intellij
  3. Jetbrains Clion
  4. Clion Intellij Ultimate
NewsReleases

In the previous blog post on IntelliJ Rust, we described the plugin’s major update of the 2020.3 release cycle – more support and a new UI for Cargo features. In brief, you can now toggle workspace features right in the Cargo.toml file, and code insight across the whole of your project will be adjusted accordingly.

Now let’s take a look at the improvements that have been made to this functionality already, along with other updates the plugin has received over the last few months:

More code insight for Cargo features

IntelliJ Rust now gives completion suggestions and provides navigation across features in Cargo.toml. You can also jump to a feature declaration from a cfg or cfg_attr attribute in your Rust code:

Rustfmt as default formatter

Clion

If you would prefer Rustfmt to be the default formatter for your code, tick the Use rustfmt instead of built-in formatter checkbox in Settings / Preferences Languages & Frameworks Rust Rustfmt.

Currently, this option doesn’t apply when reformatting a selection. If you select a region and call Reformat Code (Ctrl+Alt+L on Linux/Windows, ⌥⌘L on macOS), the IDE’s formatter will be used instead.

Improvements in refactorings

  • The Move (F6) refactoring now supports re-exports when moving a file:

    If you select a piece of code in the editor and then call Move, the refactoring will take your selection into account when suggesting the items to be moved.

    Related impl-s are now moved together with the items, and the items with related impl– s are grouped together for easier navigation in the refactoring dialog:

    You can now use Move to place a file into another crate or even move multiple files and directories.

    Also, Move is now capable of detecting visibility conflicts (and making a moved item public if required), as well as other compilation errors which may occur during a move, like E0116: An inherent implementation was defined for a type outside the current crate or E0117: Only traits defined in the current crate can be implemented for arbitrary types.

  • Aside from Move, we also added a new Inline (Ctrl+Alt+N on Linux/Windows, ⌥⌘N on macOS) refactoring for local variables:

New experimental engine for name resolution

We’ve started to redesign a part of the name resolve engine. The newer version of the algorithm (aka name resolution 2.0) is in the experimental state. If you are ready to give it a try, enable the Use experimental name resolution engine checkbox in Settings / Preferences Languages & Frameworks Rust:

Our new algorithm uses the fixed-point iteration approach and aims to provide better support for complex glob imports (use foo::*) and re-exports (use foo as bar). It will also allow the plugin to properly expand the upcoming macros 2.0.

At the same time, the new algorithm addresses some of the existing macro-related issues. For example, it improves resolve for the code where a macro expands into another macro’s definition. It also fixes the problem with macro expansion inside an included file.

The following code fragment gives an example of how the new engine handles complex resolve:

Note that the new algorithm works for top-level items only, so local variables and type inference functionality won’t be affected.

If you are interested in the implementation details of the new algorithm, you can find a longer explanation in this ticket.

This feature is in its early stages of development, so we encourage you to try it out and let us know if you have any issues. Please use the plugin’s issue tracker: just select a problematic piece of code and call Help Create New Issue.

Cargo-generate project templates

The plugin’s wizard for creating new projects has been enhanced with two more templates, WebAssembly Lib and Procedural Macro, and the option to add other Git repositories as templates to be used with cargo-generate.

If you don’t have cargo-generate installed, you will be able to do that from the New Project dialog.

WASM projects support

Are you working with Rust and WebAssembly together? We recently started working on WASM support, and here are the features that are already available:

  • The WebAssembly Lib template helps you quickly create new projects based on wasm-pack-template.
  • The new wasm-pack configuration lets you run wasm-pack commands without leaving the IDE.

    When you create a project using the WebAssembly Lib template, the plugin adds a Build configuration of this type automatically:

    You can use a wasm-pack configuration in the same way as any other IDE configuration, including by calling it from Help Run Anything (press Ctrl twice).

  • The Go to generated declaration gutter marker lets you navigate from the #[wasm_bindgen] attribute to the corresponding TypeScript code:

If you are interested in tracking the progress of WASM support, please follow this issue. Also, please let us know if there are any other IDE features for Rust and WebAssembly that you would like the plugin to have.

Other news

Other notable updates include completion for rustc and clippy lint attributes, and new intentions for creating a function/method from an unresolved call and for importing a qualified path.

Also, debugging for your Rust code in IntelliJ IDEA Ultimate is now available on Windows with LLDB under the MSVC toolchain. Just a quick reminder: you need the Native Debugging Support plugin for this (the IDE will prompt you to install it). There are some limitations for Rust support in MSVC LLDB though, see this issue for details.

We would like to take this opportunity to thank the external contributors who have helped us in this release cycle. Many features and fixes wouldn’t have made it to the plugin without your efforts! Our thanks go to:

Thank you for reading and stay tuned!

Your Rust team
JetBrains
The Drive to Develop

NewsReleases

This is the first entry we are publishing in a dedicated blog for IntelliJ Rust! Previously hosted on the CLion blog, our articles were tied closely to that particular IDE. From now on, we’ll be describing the plugin’s news and features with regard to all the IDEs it’s compatible with.

Have you already explored the documentation we released a while ago? If not, we encourage you to check it out! It describes the plugin in full detail and also gives some general IDE-related info. Our documentation system is still in active development on both the frontend and the content edge, so your feedback is very welcome! Please share your experience in the comments below or submit an issue in our tracker (we are working on a more convenient solution for collecting feedback on the docs).

Now let’s dive into the updates that have landed in the plugin in this release cycle.

Debugging in more IDEs

Previously, debugging for your Rust code was available in CLion and IntelliJ IDEA Ultimate only. Starting from the 2021.1 version of the IDEs, it also works in GoLand and PyCharm Pro. It is implemented similarly to that in IntelliJ IDEA Ultimate and requires the Native Debugging Support plugin and works with LLDB.

Note that on Windows your project should be built using Rust’s MSVC toolchain (see this issue for details on MSVC LLDB support).

Structured view in the Build tool window

The structured view for the compiler’s output inside the Build tool window is now enabled by default. The dedicated tab, Build Output, opens up automatically when you call any Cargo command with a building step, such as build, run, test, check, and others.

By default, it shows warnings and failures for a build. Use the ‘eye’ button in the left-hand pane if you prefer successful steps to be displayed as well:

This structured view works with Cargo versions 1.48.0 and later. If you are using an earlier Cargo version, the compiler’s output will be logged in plain text as before.

ClionClion intellij free

Improvements in refactorings

Change Signature

If you are working in a JetBrains IDE with code in languages other than Rust, you might be accustomed to the Change Signature refactoring. Now it works for Rust too!

This refactoring can help you quickly change the name and return type of a function, modify the list of the parameters and set the default ones, and also add the async or unsafe prefix.

Currently, the implementation of Change Signature for Rust lacks the suggestions available for other languages. We plan to add this functionality shortly.

Rename suggestions

Now you don’t have to call Rename manually when changing a code element like struct, function, or local variable. Just start typing a new name, and the refactoring will suggest a list of hints right away:

Editor updates

All Rust-related actions are now grouped under a separate node in the Tools section of the main menu and in context menus all over the IDE:

Clion Intellij Vs

A new action, Share in Playground, is a timesaver when you need to share a piece of code on Rust Playground. Make a selection, call Tools Rust Share in Playground, and IJ Rust will post your code there for you:

Another notable update in the editor is the new intention for making an item public or private:

Enhancements in conditional compilation support

In this release cycle, we added the Find Usages functionality for Cargo features to help you easily navigate between the usages of a particular feature across the entire code base:

Clion Intellij

Completion now works for the feature argument, as well as the features’ values, in both cfg and cfg_attr attributes:

Getting to cfg_attr support, IJ Rust now takes the nested attributes inside cfg_attr into account during name resolution and code analysis. This applies to the cases like cfg_attr(..., derive(...)) or cfg_attr(..., path='...').

Experimental name resolution engine: fixes, features, and optimizations

In the previous blog post, we announced a redesign of the plugin’s name resolution engine. The new engine is still in the experimental stage and is disabled by default. To give it a try, enable the Use experimental name resolution engine checkbox in Settings / Preferences Languages & Frameworks Rust.

Over the last months, the new engine has received a lot of fixes and updates. Here are a few of the key ones:

  • The new engine is now capable of resolving derive procedural macros (learn more on procedural macros support below).
  • It finds all possible impl blocks for a type alias. Previously, for performance reasons, they were processed only when the number of aliases for the corresponding type didn’t exceed 10. Now the crates that heavily use type aliases, such as nalgebra or winapi, can be resolved properly.
  • It supports file-level #![macro_use] and cfg attributes.
  • It fully supports textual scoping when resolving macros.
  • It properly resolves multi-segment macro paths and macro calls inside files included by include!.

On top of that, the engine’s memory consumption has been reduced significantly, along with an overall speedup of the algorithm. This is especially noticeable in large Rust modules.

Initial support for procedural macros

Jetbrains Clion

IntelliJ Rust is now capable of expanding function-like procedural macros, providing them with syntax highlighting, completion, the Show Macro Expansion popup, and other features already available for declarative macros.

The current implementation is in its early stages, so please mind possible issues and unexpected behaviour in some cases. To try it out, call Help Find Action (Ctrl+Shift+A on Linux/Windows, ⇧⌘A on macOS), search for Experimental Features, and enable org.rust.cargo.evaluate.build.scripts and org.rust.macros.proc:

Make sure to reload the project before checking out your code.

If you are interested in the progress of procedural macros support, keep an eye on this tracking issue.

We would like to continue the tradition of giving thanks to the external contributors who have helped us in this release cycle. Thank you for dedicating your time and effort to IntelliJ Rust!

That’s it for the most recent updates in the IJ Rust plugin. Thank you for reading and stay tuned!

Clion Intellij Ultimate

Your Rust team
JetBrains
The Drive to Develop