11# Rust support for Visual Studio Code
22
33[ ![ ] ( https://vsmarketplacebadge.apphb.com/version/rust-lang.rust.svg )] ( https://marketplace.visualstudio.com/items?itemName=rust-lang.rust )
4- [ ![ Build Status] ( https://travis-ci.com/rust-lang /rls-vscode.svg?branch=master )] ( https://travis-ci.com/rust-lang /rls-vscode )
4+ [ ![ Build Status] ( https://travis-ci.com/AndriesK /rls-vscode.svg?branch=master )] ( https://travis-ci.com/AndriesK /rls-vscode )
55
66Adds language support for Rust to Visual Studio Code. Supports:
77
8- * code completion
9- * jump to definition, peek definition, find all references, symbol search
10- * types and documentation on hover
11- * code formatting
12- * refactoring (rename, deglob)
13- * error squiggles and apply suggestions from errors
14- * snippets
15- * build tasks
16-
8+ - code completion
9+ - jump to definition, peek definition, find all references, symbol search
10+ - types and documentation on hover
11+ - code formatting
12+ - refactoring (rename, deglob)
13+ - error squiggles and apply suggestions from errors
14+ - snippets
15+ - build tasks
1716
1817Rust support is powered by the [ Rust Language Server] ( https://github.com/rust-lang/rls )
1918(RLS). If you don't have it installed, the extension will install it for you.
@@ -33,20 +32,18 @@ advice.
3332Contributing code, tests, documentation, and bug reports is appreciated! For
3433more details on building and debugging, etc., see [ contributing.md] ( contributing.md ) .
3534
36-
3735## Quick start
3836
39- * Install [ rustup] ( https://www.rustup.rs/ ) (Rust toolchain manager).
40- * Install this extension from [ the VSCode Marketplace] ( https://marketplace.visualstudio.com/items?itemName=rust-lang.rust )
37+ - Install [ rustup] ( https://www.rustup.rs/ ) (Rust toolchain manager).
38+ - Install this extension from [ the VSCode Marketplace] ( https://marketplace.visualstudio.com/items?itemName=rust-lang.rust )
4139 (or by entering ` ext install rust-lang.rust ` at the command palette <kbd >Ctrl</kbd >+<kbd >P</kbd >).
42- * (Skip this step if you already have Rust projects that you'd like to work on.)
40+ - (Skip this step if you already have Rust projects that you'd like to work on.)
4341 Create a new Rust project by following [ these instructions] ( https://doc.rust-lang.org/book/ch01-03-hello-cargo.html ) .
44- * Open a Rust project (` File > Add Folder to Workspace... ` ). Open the folder for the whole
42+ - Open a Rust project (` File > Add Folder to Workspace... ` ). Open the folder for the whole
4543 project (i.e., the folder containing 'Cargo.toml'), not the 'src' folder.
46- * You'll be prompted to install the RLS. Once installed, the RLS should start
44+ - You'll be prompted to install the RLS. Once installed, the RLS should start
4745 building your project.
4846
49-
5047## Configuration
5148
5249This extension provides options in VSCode's configuration settings. These
@@ -57,11 +54,11 @@ have Intellisense help.
5754
5855Some highlights:
5956
60- * ` rust.show_warnings ` - set to false to silence warnings in the editor.
61- * ` rust.all_targets ` - build and index code for all targets (i.e., integration tests, examples, and benches)
62- * ` rust.cfg_test ` - build and index test code (i.e., code with ` #[cfg(test)] ` /` #[test] ` )
57+ - ` rust.show_warnings ` - set to false to silence warnings in the editor.
58+ - ` rust.all_targets ` - build and index code for all targets (i.e., integration tests, examples, and benches)
59+ - ` rust.cfg_test ` - build and index test code (i.e., code with ` #[cfg(test)] ` /` #[test] ` )
6360
64- * ` rust-client.channel ` - specifies from which toolchain the RLS should be spawned
61+ - ` rust-client.channel ` - specifies from which toolchain the RLS should be spawned
6562
6663## Features
6764
@@ -72,16 +69,16 @@ includes snippet names as options when you type; select one by pressing 'enter'.
7269You can move to the next 'hole' in the template by pressing 'tab'. We provide
7370the following snippets:
7471
75- * ` for ` - a for loop
76- * ` unimplemented `
77- * ` unreachable `
78- * ` print(ln) `
79- * ` assert(_eq) `
80- * ` macro_rules ` - declare a macro
81- * ` if let Option ` - an ` if let ` statement for executing code only in the ` Some `
72+ - ` for ` - a for loop
73+ - ` unimplemented `
74+ - ` unreachable `
75+ - ` print(ln) `
76+ - ` assert(_eq) `
77+ - ` macro_rules ` - declare a macro
78+ - ` if let Option ` - an ` if let ` statement for executing code only in the ` Some `
8279 case.
83- * ` spawn ` - spawn a thread
84- * ` extern crate ` - insert an ` extern crate ` statement
80+ - ` spawn ` - spawn a thread
81+ - ` extern crate ` - insert an ` extern crate ` statement
8582
8683This extension is deliberately conservative about snippets and doesn't include
8784too many. If you want more, check out
@@ -97,22 +94,19 @@ The plugin writes these into `tasks.json`. The plugin will not overwrite
9794existing tasks, so you can customise these tasks. To refresh back to the
9895defaults, delete ` tasks.json ` and restart VSCode.
9996
100-
10197## Format on save
10298
10399To enable formatting on save, you need to set the ` editor.formatOnSave ` setting
104100to ` true ` . Find it under ` File > Preferences > Settings ` .
105101
106-
107102## Requirements
108103
109- * [ Rustup] ( https://www.rustup.rs/ ) ,
110- * A Rust toolchain (the extension will configure this for you, with
104+ - [ Rustup] ( https://www.rustup.rs/ ) ,
105+ - A Rust toolchain (the extension will configure this for you, with
111106 permission),
112- * ` rls ` , ` rust-src ` , and ` rust-analysis ` components (the
107+ - ` rls ` , ` rust-src ` , and ` rust-analysis ` components (the
113108 extension will install these for you, with permission).
114109
115-
116110## Implementation
117111
118112This extension almost exclusively uses the RLS for its feature support (syntax
@@ -121,4 +115,3 @@ the Rust compiler (`rustc`) to get data about Rust programs. It uses Cargo to
121115manage building. Both Cargo and ` rustc ` are run in-process by the RLS. Formatting
122116and code completion are provided by ` rustfmt ` and Racer, again both of these are
123117run in-process by the RLS.
124-
0 commit comments