You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 8, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: doc/rls_mode/main.md
+67-43Lines changed: 67 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,41 +1,74 @@
1
1
# Rust Language Server Mode Page
2
2
3
-
The extension supports integration with [Rust Language Server](https://github.com/rust-lang-nursery/rls).
3
+
The extension supports integration with [Rust Language Server].
4
4
5
5
## Configuration
6
6
7
-
The `"rust.rls"` configuration parameter specifies how to run RLS if it is requested.
7
+
There are configuration parameters which names start with `"rust.rls"`.
8
+
The RLS mode can be configured by changing the parameters.
8
9
9
-
The type of the parameter is an object with the following fields:
10
+
### Parameters
10
11
11
-
*`"executable"` - a string. The path to an executable to execute
12
-
*`"args"` - an array of strings. Arguments to pass to the executable
13
-
*`"env"` - an environment to append to the current environment to execute the executable
14
-
*`"revealOutputChannelOn"` - a string. Specifies the condition when the output channel should be revealed
15
-
*`"useRustfmt"` - either a boolean or `null`. Specifies whether [rustfmt] should be used for formatting
12
+
#### rust.rls.executable
16
13
17
-
By default, it is `null`.
14
+
Using the parameter it is possible to specify either absolute path to RLS or name of RLS.
18
15
19
-
### More about configuration parameter
16
+
The default value is `"rls"`.
20
17
21
-
#### revealOutputChannelOn
18
+
It can be useful when:
22
19
23
-
This determines when the Output channel is revealed.
20
+
* There is a need in running RLS built from its source
21
+
* There is a need in running RLS through some proxy (see [rust.rls.args](#rust.rls.executable]))
24
22
25
-
The possible values are:
23
+
#### rust.rls.args
26
24
27
-
*`"info"` - revealed on each info line
28
-
*`"warn"` - revealed on each warn line
29
-
*`"error"` - revealed on each error line (default)
30
-
*`"never"` - the output channel never reveals automatically
25
+
Using the parameter it is possible to specify what arguments to run the RLS executable with.
31
26
32
-
#### useRustfmt
27
+
The default value is `null`.
33
28
34
-
The possible values are:
29
+
It can be useful when:
35
30
36
-
*`null` - the extension will ask whether [rustfmt] should be used for formatting
37
-
*`false` - the extension will not use [rustfmt] for formatting
38
-
*`true` - the extension will use [rustfmt] for formatting
31
+
* There is a need in running RLS through some proxy, i.e., rustup
32
+
33
+
#### rust.rls.env
34
+
35
+
Using the parameter it is possible to specify what environment to run the RLS executable in.
36
+
37
+
The default value is `null`.
38
+
39
+
It can be useful when:
40
+
41
+
* There is a need to pass some environment variables to the RLS executable, i.e., `RUST_LOG`, `RUST_BACKTRACE`
42
+
43
+
#### rust.rls.revealOutputChannelOn
44
+
45
+
Using the parameter it is possible to specify on what kind of message received from the RLS the output channel is revealed.
46
+
47
+
It supports one of the following values:
48
+
49
+
*`"info"` - the output channel is revealed on literally all messages
50
+
*`"warn"` - the output channel is revealed on warnings
51
+
*`"error"` - the output channel is revealed on errors (default)
52
+
*`"never"` - the output channel is never revealed automatically (it can be revealed manually through *View->Output*)
53
+
54
+
The default value is `error`.
55
+
56
+
It can be useful when:
57
+
58
+
* There is some problem with RLS and it sometimes sends error messages on which the output channel is revealed and it is annoying
59
+
* There is a need in revealing the output channel on other kinds of message
60
+
61
+
#### rust.rls.useRustfmt
62
+
63
+
Using the parameter it is possible to specify if the standalone [rustfmt] is used to format code instead of the [rustfmt] embedded into RLS.
64
+
65
+
It supports one of the following values:
66
+
67
+
*`null` - the extension will ask if [rustfmt] is used to format code
68
+
*`false` - the extension will not use [rustfmt] to format code
69
+
*`true` - the extension will use [rustfmt] to format code
70
+
71
+
The default value is `null`.
39
72
40
73
## Setting up
41
74
@@ -80,21 +113,17 @@ rustup run nightly cargo install
80
113
Because at the moment RLS links to the compiler and it assumes the compiler to be globally installed, one has to use rustup to start the `rls` (rustup will configure the environment accordingly):
81
114
82
115
```json
83
-
"rust.rls": {
84
-
"executable": "rustup",
85
-
"args": ["run", "nightly", "rls"]
86
-
}
116
+
"rust.rls.executable": "rustup",
117
+
"rust.rls.args": ["run", "nightly", "rls"]
87
118
```
88
119
89
120
--
90
121
91
122
You can also run from source by passing `+nightly` to rustup's cargo proxy:
0 commit comments