diff options
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | README.md | 30 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/edit.rs | 10 |
3 files changed, 15 insertions, 29 deletions
diff --git a/Cargo.lock b/Cargo.lock index 91edb460c..80e778bcf 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -884,9 +884,9 @@ dependencies = [ | |||
884 | 884 | ||
885 | [[package]] | 885 | [[package]] |
886 | name = "quote" | 886 | name = "quote" |
887 | version = "1.0.2" | 887 | version = "1.0.3" |
888 | source = "registry+https://github.com/rust-lang/crates.io-index" | 888 | source = "registry+https://github.com/rust-lang/crates.io-index" |
889 | checksum = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" | 889 | checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" |
890 | dependencies = [ | 890 | dependencies = [ |
891 | "proc-macro2", | 891 | "proc-macro2", |
892 | ] | 892 | ] |
@@ -14,33 +14,9 @@ Work on rust-analyzer is sponsored by | |||
14 | - [Mozilla](https://www.mozilla.org/en-US/) | 14 | - [Mozilla](https://www.mozilla.org/en-US/) |
15 | - [freiheit.com](https://www.freiheit.com) | 15 | - [freiheit.com](https://www.freiheit.com) |
16 | 16 | ||
17 | ## Language Server Quick Start | 17 | ## Quick Start |
18 | 18 | ||
19 | rust-analyzer is a work-in-progress, so you might encounter critical bugs. That | 19 | https://rust-analyzer.github.io/manual.html#installation |
20 | said, it is complete enough to provide a useful IDE experience and some people | ||
21 | use it as a daily driver. | ||
22 | |||
23 | To build rust-analyzer, you need: | ||
24 | |||
25 | * latest stable Rust for the language server itself | ||
26 | * latest stable npm and VS Code for VS Code extension | ||
27 | |||
28 | To quickly install the rust-analyzer language server and VS Code extension with | ||
29 | standard setup (`code` and `cargo` in `$PATH`, etc), use this: | ||
30 | |||
31 | ``` | ||
32 | # clone the repo | ||
33 | $ git clone https://github.com/rust-analyzer/rust-analyzer && cd rust-analyzer | ||
34 | |||
35 | # install both the language server and VS Code extension | ||
36 | $ cargo xtask install | ||
37 | |||
38 | # alternatively, install only the server. Binary name is `rust-analyzer`. | ||
39 | $ cargo xtask install --server | ||
40 | ``` | ||
41 | |||
42 | For non-standard setup of VS Code and other editors, or if the language server | ||
43 | cannot start, see [./docs/user](./docs/user). | ||
44 | 20 | ||
45 | ## Documentation | 21 | ## Documentation |
46 | 22 | ||
@@ -48,7 +24,7 @@ If you want to **contribute** to rust-analyzer or are just curious about how | |||
48 | things work under the hood, check the [./docs/dev](./docs/dev) folder. | 24 | things work under the hood, check the [./docs/dev](./docs/dev) folder. |
49 | 25 | ||
50 | If you want to **use** rust-analyzer's language server with your editor of | 26 | If you want to **use** rust-analyzer's language server with your editor of |
51 | choice, check [./docs/user](./docs/user) folder. It also contains some tips & tricks to help | 27 | choice, check [the manual](https://rust-analyzer.github.io/manual.html) folder. It also contains some tips & tricks to help |
52 | you be more productive when using rust-analyzer. | 28 | you be more productive when using rust-analyzer. |
53 | 29 | ||
54 | ## Getting in touch | 30 | ## Getting in touch |
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index d2630e9e9..1858e2b6c 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs | |||
@@ -249,6 +249,16 @@ impl ast::PathSegment { | |||
249 | } | 249 | } |
250 | } | 250 | } |
251 | 251 | ||
252 | impl ast::UseItem { | ||
253 | #[must_use] | ||
254 | pub fn with_use_tree(&self, use_tree: ast::UseTree) -> ast::UseItem { | ||
255 | if let Some(old) = self.use_tree() { | ||
256 | return replace_descendants(self, iter::once((old, use_tree))); | ||
257 | } | ||
258 | self.clone() | ||
259 | } | ||
260 | } | ||
261 | |||
252 | #[must_use] | 262 | #[must_use] |
253 | pub fn strip_attrs_and_docs<N: ast::AttrsOwner>(node: &N) -> N { | 263 | pub fn strip_attrs_and_docs<N: ast::AttrsOwner>(node: &N) -> N { |
254 | N::cast(strip_attrs_and_docs_inner(node.syntax().clone())).unwrap() | 264 | N::cast(strip_attrs_and_docs_inner(node.syntax().clone())).unwrap() |