Github page on Rust setup for different IDEs


#1

Hello everyone!

I would like to know if there is a page on rust setup for different IDEs and how to setup you dev environnement ?
I recently tested a lot of editors and, although it is quite easy on Linux (maybe because I have way more experience programming on Linux?), I found Windows to be a real NIGHTMARE to setup.

EDIT: Here it is!


#2

Linkified, don’t be afraid to show your work! :wink:


#3

Here is a really really quick page that I did just to get started: Rust IDEs

I will begin the work on this when I get home tonight. I will need to get some VMs working to test everything out.

I am considering doing all Linux tests on a Ubuntu machine, would that be enough (I only use Ubuntu for my server, I am an Arch Linux user, but if I’m not mistaken, Ubuntu/Debian based distros are still on top) ? And Windows tests on a Windows 10 machine.

I want to make this on a github page to have the community input: I am curious to see how everone has it’s environment set-up.


#4

I am currently making the Vim on Linux section, but it’s taking more time than I thought ! Vim is harder than I remembered to setup. This will be useful even for me in the future :stuck_out_tongue:

Edit: Section added: Rust-IDEs Vim


#5

There was this site areweideyet.com which is kind of dated. Would be great to fix it a bit.

Regarding to your vim configuration, would be great to have a list of minimum needed stuff and then optional things. For instance, I guess YCM could be optional.


#6

I know about AreWeIdeYet, and I will link to it. But it doesn’t have enough information. Just links. Seeing how much time it takes me to write a part of this, simple and clear instructions to get started are needed. I really had trouble getting started with all of this.

Yes, but Ale would be optional too then :confused:. Since the goal is to reproduce the experience you can have on a fully fledged IDE, I think YCM is needed for code completion (Ale looks to have almost the same, but it seems to be in development and YCM is known by a lot of people).
The issue with VIM is that it’s so customizable that everything is optional.

If you have any other suggestions, feel free to open an Issue or a Pull Request!

I added the VSCode section for Linux and am working GVim for windows.

A great addition that is on my todo list is to let people choose between RLS and Cago check. Although I really like RLS, I have used Cargo check so much that I find RLS intrusive at times.


#7

I just pushed the GVim for windows section, but Ale and Syntastic don’t work :confused:.
Here is my _vimrc file:

set encoding=utf-8
call plug#begin()

Plug 'valloric/youcompleteme'
Plug 'w0rp/ale'
Plug 'vim-syntastic/syntastic'

call plug#end()

let g:ale_linters = {'rust': ['rls']}


let g:syntastic_always_populate_loc_list = 1
let g:syntastic_loc_list_height = 3
let g:syntastic_check_on_open = 1

let g:syntastic_rust_rustc_exe = 'cargo check --all-features'
let g:syntastic_rust_rustc_fname = ''
let g:syntastic_rust_rustc_args = '--'
let g:syntastic_rust_checkers = ['rustc']

Comments have been removed because markdown doesn’t like them, but I commented Ale to test Syntastic.

Is there a step I am not aware of ?

:SyntascticInfo doesn’t report any available checkers.


#8

Syntastic wasn’t configured right and Ale had a bug on Windows. w0rp (the creator of Ale) pushed an update that fixed it.

The Sublime Text 3 section is getting tested, but I have troubles getting RLS to work with it. More testing needs to be done.


#9

Wouldn’t it be better to add this kind of documentation to each IDE/project rather than having another separate repo that may be duplicating work?

For example, intellij-rust already has a quick-start guide.

VSCode’s Rust plugin has a documentation page that could potentially be improved: https://github.com/editor-rs/vscode-rust/blob/master/doc/main.md

As these tools evolve, your instructions could get out of date.


#10

Yes, this is the reason why I decided to use a github page in the first place. I wanted the community to to participate by sending an issue.
Vim won’t get outdated as long as I use it.

What I wanted was a complete guide to get things working. The Rust community is amazing and documentation is everywhere. But I couldn’t find a single place that explains to you how to set everything up.
I try to write the less instructions as possible (I have links to a lot of greatly documented installations).

For example, the vim setup page is maybe the only one that will stay. Vim setup on windows is a nightmare and on Linux you still need to know what to use and how to configure things. Since I do everything myself right now, I would have loved to have something like this to help me set everything up.

This is what I will link for the IntelliJ section for sure. But it lacks the instructions on how to activate cargo check to have the compiler check for your errors. (IntelliJ has always been pretty straight forward)

I will look into this, maybe they would accept a PR with what I did in my VS Code section. Then I would only have a link to their page.


#11

Ok, I’ll chime in with my EMACS setup miniguide (scroll to the end of the doc) and my setup file I move between my home/office workstations.

Basically I have:

  • racer
  • rustfmt
  • syntax highlighting
  • autocompletion / suggestion
  • autoformatting
  • error check/highlighting when saving
  • push/pop into function definition
  • [TODO] define shortcuts for cargo build | check | run

hth


#12

Doesn’t work :confused: (the link has been pasted twice)

This is a great addition to the git. Can I put a link to reference it ?

What does flycheck-rust use ? (from what I can understand it is what you use for error checking in Emacs) Is it cargo check (checks the error on save) or RLS for live checking of errors ?


#13

@Luxed are you on IRC?, have a couple of questions about this and I may be able to provide some others tiny enhancements but it’s better if we can chat a bit.


#14

@spastorino I’m sorry, I have a Discord, Slack and other tools but I never used IRC. These forums have a great private message system that works really well. You can use this to message me or give me what I need to join you on IRC.


#15

Sure. Any improvements and suggestions are welcome!

Yes, as far as I understand. RLS would probably check your code while writing without saving first (I’ll fix that too in my previous post)


#16

Are you in https://rust-lang.slack.com/ ? couldn’t find you, what’s your username there?.
To join IRC you just need an IRC client. There are even web clients and then join moznet. There’s plenty of info out there and I think even rust-lang.org has some info.


#17

I just joined the Slack, didn’t even there was one.
I should be found by the Display Name: Luxed