vscode-rust | Rust extension for Visual Studio Code
kandi X-RAY | vscode-rust Summary
kandi X-RAY | vscode-rust Summary
Rust extension for Visual Studio Code
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vscode-rust
vscode-rust Key Features
vscode-rust Examples and Code Snippets
Community Discussions
Trending Discussions on vscode-rust
QUESTION
I'm fairly new to rust and have been following the official book that they provide on their site. During chapter 2 they tell you to import a "Rand" cargo which I did. However, when I try to run my code directly through VS Code I get an error saying "unresolved import rand
". When I run it through command prompt, everything works fine. I've already tried every solution suggested here: https://github.com/rust-lang/rls-vscode/issues/513 and nothing seemed to have worked. Extensions that I'm using:
- Better TOML
- Cargo
- Code Runner
- Rust (rls)
- Rust Assist
- vsc-rustfmt
- vscode-rust-syntax
Has anyone else ran into a similar problem or a know a solution? Thank you!
Edit: My Cargo.TOML looks like this:
...ANSWER
Answered 2020-Mar-01 at 15:17Got a fix!
In VSC, select Extensions, select the Code Runner extension, click the little gear symbol and select Extension Settings. It's the Code-runner: Executor Map setting that needs to be changed. Click the 'Edit in settings.json' link.
Add the following to the file:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vscode-rust
Install this extension from the VSCode Marketplace (or by entering ext install rust-lang.rust at the command palette Ctrl+P).
(Skip this step if you already have Rust projects that you'd like to work on.) Create a new Rust project by following these instructions.
Open a Rust project (File > Add Folder to Workspace...). Open the folder for the whole project (i.e., the folder containing Cargo.toml, not the src folder).
You'll be prompted to install the Rust server. Once installed, it should start analyzing your project (RLS will also have to to build the project).
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page