diff options
author | Aleksey Kladov <[email protected]> | 2019-01-13 14:13:54 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-13 14:13:54 +0000 |
commit | c46e0300e6cebf78c78c28ca91e45b57e4e40954 (patch) | |
tree | 89c0b43940fac0c196bb848062443c6c59a2edd3 /editors | |
parent | ff09d151241cf0bc14cd7ecb015350a77f882969 (diff) |
note about performance
Diffstat (limited to 'editors')
-rw-r--r-- | editors/README.md | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/editors/README.md b/editors/README.md index 9ed65e631..b35a1f367 100644 --- a/editors/README.md +++ b/editors/README.md | |||
@@ -9,7 +9,7 @@ $ cargo install-code | |||
9 | $ rustup component add rust-src | 9 | $ rustup component add rust-src |
10 | ``` | 10 | ``` |
11 | 11 | ||
12 | This will run `cargo install --packge ra_lsp_server` to install the server | 12 | This will run `cargo install --package ra_lsp_server` to install the server |
13 | binary into `~/.cargo/bin`, and then will build and install plugin from | 13 | binary into `~/.cargo/bin`, and then will build and install plugin from |
14 | `editors/code`. See | 14 | `editors/code`. See |
15 | [this](https://github.com/rust-analyzer/rust-analyzer/blob/0199572a3d06ff66eeae85a2d2c9762996f0d2d8/crates/tools/src/main.rs#L150) | 15 | [this](https://github.com/rust-analyzer/rust-analyzer/blob/0199572a3d06ff66eeae85a2d2c9762996f0d2d8/crates/tools/src/main.rs#L150) |
@@ -18,9 +18,9 @@ bugs! | |||
18 | 18 | ||
19 | It's better to remove existing Rust plugins to avoid interference. | 19 | It's better to remove existing Rust plugins to avoid interference. |
20 | 20 | ||
21 | ## Rust Analyzer Specifc Features | 21 | ## Rust Analyzer Specific Features |
22 | 22 | ||
23 | These features are implemented as extensions to the langauge server protocol. | 23 | These features are implemented as extensions to the language server protocol. |
24 | They are more experimental in nature and work only with VS Code. | 24 | They are more experimental in nature and work only with VS Code. |
25 | 25 | ||
26 | ### Syntax highlighting | 26 | ### Syntax highlighting |
@@ -36,7 +36,7 @@ symbols can be used to narrow down the search. Specifically, | |||
36 | - `#Foo` searches for `Foo` type in the current workspace | 36 | - `#Foo` searches for `Foo` type in the current workspace |
37 | - `#foo#` searches for `foo` function in the current workspace | 37 | - `#foo#` searches for `foo` function in the current workspace |
38 | - `#Foo*` searches for `Foo` type among dependencies, excluding `stdlib` | 38 | - `#Foo*` searches for `Foo` type among dependencies, excluding `stdlib` |
39 | - `#foo#*` seaches for `foo` function among dependencies. | 39 | - `#foo#*` searches for `foo` function among dependencies. |
40 | 40 | ||
41 | That is, `#` switches from "types" to all symbols, `*` switches from the current | 41 | That is, `#` switches from "types" to all symbols, `*` switches from the current |
42 | workspace to dependencies. | 42 | workspace to dependencies. |
@@ -87,7 +87,7 @@ Some features trigger on typing certain characters: | |||
87 | 87 | ||
88 | ### Code Actions (Assists) | 88 | ### Code Actions (Assists) |
89 | 89 | ||
90 | These are triggered in a particular context via lightbulb. We use custom code on | 90 | These are triggered in a particular context via light bulb. We use custom code on |
91 | the VS Code side to be able to position cursor. | 91 | the VS Code side to be able to position cursor. |
92 | 92 | ||
93 | 93 | ||
@@ -196,7 +196,8 @@ use algo::{<|>visitor::{Visitor, visit}}; | |||
196 | falls back to heuristic name matching for other things for the time being. | 196 | falls back to heuristic name matching for other things for the time being. |
197 | 197 | ||
198 | * **Completion**: completes paths, including dependencies and standard library. | 198 | * **Completion**: completes paths, including dependencies and standard library. |
199 | Does not handle glob imports and macros. Completes fields and inherent methods | 199 | Does not handle glob imports and macros. Completes fields and inherent |
200 | methods. | ||
200 | 201 | ||
201 | * **Outline** <kbd>alt+shift+o</kbd> | 202 | * **Outline** <kbd>alt+shift+o</kbd> |
202 | 203 | ||
@@ -216,4 +217,14 @@ use algo::{<|>visitor::{Visitor, visit}}; | |||
216 | * **Diagnostics** | 217 | * **Diagnostics** |
217 | - missing module for `mod foo;` with a fix to create `foo.rs`. | 218 | - missing module for `mod foo;` with a fix to create `foo.rs`. |
218 | - struct field shorthand | 219 | - struct field shorthand |
219 | - unnessary braces in use item | 220 | - unnecessary braces in use item |
221 | |||
222 | |||
223 | ## Performance | ||
224 | |||
225 | Rust Analyzer is expected to be pretty fast. Specifically, the initial analysis | ||
226 | of the project (i.e, when you first invoke completion or symbols) typically | ||
227 | takes dozen of seconds at most. After that, everything is supposed to be more or | ||
228 | less instant. However currently all analysis results are kept in memory, so | ||
229 | memory usage is pretty high. Working with `rust-lang/rust` repo, for example, | ||
230 | needs about 5 gigabytes of ram. | ||