aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock4
-rw-r--r--README.md30
-rw-r--r--crates/ra_syntax/src/ast/edit.rs10
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]]
886name = "quote" 886name = "quote"
887version = "1.0.2" 887version = "1.0.3"
888source = "registry+https://github.com/rust-lang/crates.io-index" 888source = "registry+https://github.com/rust-lang/crates.io-index"
889checksum = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" 889checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f"
890dependencies = [ 890dependencies = [
891 "proc-macro2", 891 "proc-macro2",
892] 892]
diff --git a/README.md b/README.md
index 13d81d4ae..1c334d55e 100644
--- a/README.md
+++ b/README.md
@@ -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
19rust-analyzer is a work-in-progress, so you might encounter critical bugs. That 19https://rust-analyzer.github.io/manual.html#installation
20said, it is complete enough to provide a useful IDE experience and some people
21use it as a daily driver.
22
23To 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
28To quickly install the rust-analyzer language server and VS Code extension with
29standard 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
42For non-standard setup of VS Code and other editors, or if the language server
43cannot 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
48things work under the hood, check the [./docs/dev](./docs/dev) folder. 24things work under the hood, check the [./docs/dev](./docs/dev) folder.
49 25
50If you want to **use** rust-analyzer's language server with your editor of 26If you want to **use** rust-analyzer's language server with your editor of
51choice, check [./docs/user](./docs/user) folder. It also contains some tips & tricks to help 27choice, check [the manual](https://rust-analyzer.github.io/manual.html) folder. It also contains some tips & tricks to help
52you be more productive when using rust-analyzer. 28you 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
252impl 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]
253pub fn strip_attrs_and_docs<N: ast::AttrsOwner>(node: &N) -> N { 263pub 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()