Add howto for CLion / IntelliJ IDE integration
This commit is contained in:
parent
7d713a2827
commit
cb99316c8a
@ -115,6 +115,7 @@ completed without error (whether or not changes were made).
|
||||
* [Sublime Text 3](https://packagecontrol.io/packages/RustFmt)
|
||||
* [Atom](atom.md)
|
||||
* Visual Studio Code using [vscode-rust](https://github.com/editor-rs/vscode-rust), [vsc-rustfmt](https://github.com/Connorcpu/vsc-rustfmt) or [rls_vscode](https://github.com/jonathandturner/rls_vscode) through RLS.
|
||||
* [IntelliJ or CLion](intellij.md)
|
||||
|
||||
|
||||
## Checking style on a CI server
|
||||
|
26
intellij.md
Normal file
26
intellij.md
Normal file
@ -0,0 +1,26 @@
|
||||
# Running Rustfmt from IntelliJ or CLion
|
||||
|
||||
## Installation
|
||||
|
||||
- Install [CLion](https://www.jetbrains.com/clion/), [IntelliJ Ultimate or CE](https://www.jetbrains.com/idea/) through the direct download link or using the [JetBrains Toolbox](https://www.jetbrains.com/toolbox/).
|
||||
CLion provides a built-in debugger interface but its not free like IntelliJ CE - which does not provide the debugger interface. (IntelliJ seems to lack the toolchain for that, see this discussion [intellij-rust/issues/535](https://github.com/intellij-rust/intellij-rust/issues/535))
|
||||
|
||||
- Install the [Rust Plugin](https://intellij-rust.github.io/) by navigating to File -> Settings -> Plugins and press "Install JetBrains Plugin"
|
||||

|
||||
|
||||
- Press "Install" on the rust plugin
|
||||

|
||||
|
||||
- Restart CLion/IntelliJ
|
||||
|
||||
## Configuration
|
||||
|
||||
- Open the settings window (File -> Settings) and search for "reformat"
|
||||

|
||||
- Right-click on "Reformat File with Rustfmt" and assign a keyboard shortcut
|
||||
|
||||

|
||||
- Press "OK"
|
||||

|
||||
|
||||
- Done. You can now use rustfmt in an opened *.rs file with your previously specified shortcut
|
Loading…
x
Reference in New Issue
Block a user