Skip to content

Latest commit

 

History

History
90 lines (55 loc) · 4.1 KB

QuickStart.md

File metadata and controls

90 lines (55 loc) · 4.1 KB

Quick Start

Bold text denotes the names of actions you can type in the Find Action dialog (Ctrl+Shift+A or quickly press Shift twice for Find Anything). Shortcuts are given for the default Windows/Linux keymap. To learn shortcuts for your keymap consult Help > Keymap reference. Shortcut for an action is also displayed in the Find Action dialog.


Creating new project

Creating new project from within IDE is not supported yet, so you have to invoke cargo new my_project from the command line and then open my_project directory.

Opening existing project in IntelliJ IDEA

After you have installed the plugin into IntelliJ IDEA you can import a project from source (if you use other IDE, see these instructions). You can import a project form the welcome screen:

idea-import

Select the directory with the project.

select-directory

Use "from existing sources" import.

from-sources

Click throught the wizard steps and select a Rust toolchain:

import-toolchain-step

Opening project (all IDEs)

Instead of importing, you can also simply open a project.

py-open

Select the directory with the project. Open any Rust file and configure toolchain:

toolchain-notification

After your project is ready...

Wait until Cargo downloads all project dependencies. To check that everything is working, try Goto Symbol (Ctrl+Alt+Shift+N) and type something. Note that dependencies are present under external libraries. Goto Symbol should also work for items from the external crates.

go-to-symbol

To execute Cargo tasks from within the IDE, you need to set up a Run Configuration. Edit configurations (Alt+Shift+F10) and add a "Cargo command" config. Be sure to click the green plus sign, and not the "Defaults" :) You can also use Alt+Insert shortcut here.

add-run-configuration

Fill in the name of a command and additional arguments.

edit-run-configuration

You should be able to compile and Run (Shift+f10) your application from the IDE now:

running

You can change toolchain in the settings (Ctrl+Alt+S), under Languages & Frameworks > Rust tab. We need Cargo from at least 1.8.0 release.

settings

Plugin automatically watches Cargo.toml for changes and communicates with Cargo to learn about project structure and dependencies. If you disable this behavior, or if you want to force a project update, you can use Refresh Cargo project action.

Updating

In general, plugin updates should go smoothly. Though, if you experience some weird behaviour, reimport your project (using Refresh Cargo project action) or/and rebuild indices (using Invalidate caches/Restart action), prior to reporting bugs.

Tips

Check out features for some neat tricks!