Full Rust setup in VSCode/Atom help

Hello!

I have been trying to start a project, using Rust, but ran into a problem: it just does not work correctly on Linux in VSCode/Atom.

Wasted 3 days, searching online, trying different tutorials/videos - nothing worked + most of the material is from 2017. I have trie Matrix chat, but no one knew what to do. Git too has no solution as people keep suggesting very random things, like "change this variable in toml file to something else, and back"

Git: https://github.com/rust-lang/rls-vscode/issues/513

Also, as this forum does not allow adding more than one image, I have posted a full question on stack overflow: visual studio code - Full Rust setup in VSCode/Atom Issue - Stack Overflow

I hope someone who has Rust fully functional on Linux in VSCode or Atom, can help.

0

I have figured out one part: problems with running your code from within the VSCode. I had to modify default code-runner command for rust:

Original command:

"rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",

Changed to:

"rust": "if [ $(basename $dir) = 'examples' ]; then cargo run --example $fileNameWithoutExt; else cargo run; fi",

And now it works, and I can run my code quickly.

Part 2: Autocomplete still is very very bad, unfortunately. I am using RLS. there is this thing racer . Is it a better choice?

I am wondering how people get a good autocomplete from Rust?

Not sure if the code runner extension could perhaps be interfering here? Autocomplete does break sometimes. Normal lldb debugging works fine out of the box.

On Debian I simply use the Rust(rls) extension and CodeLLDB. Find that restarting RLS from the command palette often helps if there are autocomplete issues. Believe rls is the more actively developed extension but could be wrong there.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.