diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 76 |
1 files changed, 33 insertions, 43 deletions
@@ -2,15 +2,13 @@ | |||
2 | 2 | ||
3 | [![Build Status](https://travis-ci.org/rust-analyzer/rust-analyzer.svg?branch=master)](https://travis-ci.org/rust-analyzer/rust-analyzer) | 3 | [![Build Status](https://travis-ci.org/rust-analyzer/rust-analyzer.svg?branch=master)](https://travis-ci.org/rust-analyzer/rust-analyzer) |
4 | 4 | ||
5 | Rust Analyzer is an **experimental** modular compiler frontend for the | 5 | Rust Analyzer is an **experimental** modular compiler frontend for the Rust |
6 | Rust language, which aims to lay a foundation for excellent IDE | 6 | language, which aims to lay a foundation for excellent IDE support. |
7 | support. | ||
8 | 7 | ||
9 | It doesn't implement much of compiler functionality yet, but the | 8 | It doesn't implement much of compiler functionality yet, but the white-space |
10 | white-space preserving Rust parser works, and there are significant | 9 | preserving Rust parser works, and there are significant chunks of overall |
11 | chunks of overall architecture (indexing, on-demand & lazy | 10 | architecture (indexing, on-demand & lazy computation, snapshotable world view) |
12 | computation, snapshotable world view) in place. Some basic IDE | 11 | in place. Some basic IDE functionality is provided via a language server. |
13 | functionality is provided via a language server. | ||
14 | 12 | ||
15 | Work on the Rust Analyzer is sponsored by | 13 | Work on the Rust Analyzer is sponsored by |
16 | 14 | ||
@@ -30,53 +28,45 @@ $ cargo run --package ra_cli parse < crates/ra_syntax/src/lib.rs | |||
30 | 28 | ||
31 | # show symbols of a Rust file | 29 | # show symbols of a Rust file |
32 | $ cargo run --package ra_cli symbols < crates/ra_syntax/src/lib.rs | 30 | $ cargo run --package ra_cli symbols < crates/ra_syntax/src/lib.rs |
33 | ``` | ||
34 | 31 | ||
35 | To try out the language server, see [these | 32 | # install the language server |
36 | instructions](./editors/README.md). Please note that the server is not | 33 | $ cargo install --path crates/ra_lsp_server |
37 | ready for general use yet. If you are looking for a Rust IDE that | 34 | ``` |
38 | works, use [IntelliJ | ||
39 | Rust](https://github.com/intellij-rust/intellij-rust) or | ||
40 | [RLS](https://github.com/rust-lang-nursery/rls). That being said, the | ||
41 | basic stuff works, and rust analyzer is developed in the rust analyzer | ||
42 | powered editor. | ||
43 | 35 | ||
36 | See [these instructions](./editors/README.md) for VS Code setup and the list of | ||
37 | features (some of which are VS Code specific). | ||
44 | 38 | ||
45 | ## Current Status and Plans | 39 | ## Current Status and Plans |
46 | 40 | ||
47 | Rust analyzer aims to fill the same niche as the official [Rust | 41 | Rust analyzer aims to fill the same niche as the official [Rust Language |
48 | Language Server](https://github.com/rust-lang-nursery/rls), but uses a | 42 | Server](https://github.com/rust-lang-nursery/rls), but uses a significantly |
49 | significantly different architecture. More details can be found [in | 43 | different architecture. More details can be found [in this |
50 | this | ||
51 | thread](https://internals.rust-lang.org/t/2019-strategy-for-rustc-and-the-rls/8361), | 44 | thread](https://internals.rust-lang.org/t/2019-strategy-for-rustc-and-the-rls/8361), |
52 | but the core issue is that RLS works in the "wait until user stops | 45 | but the core issue is that RLS works in the "wait until user stops typing, run |
53 | typing, run the build process, save the results of the analysis" mode, | 46 | the build process, save the results of the analysis" mode, which arguably is the |
54 | which arguably is the wrong foundation for IDE. | 47 | wrong foundation for IDE. |
55 | 48 | ||
56 | Rust Analyzer is a hobby project at the moment, there's exactly zero | 49 | Rust Analyzer is an experimental project at the moment, there's exactly zero |
57 | guarantees that it becomes production-ready one day. | 50 | guarantees that it becomes production-ready one day. |
58 | 51 | ||
59 | The near/mid term plan is to work independently of the main rustc | 52 | The near/mid term plan is to work independently of the main rustc compiler and |
60 | compiler and implement at least simplistic versions of name | 53 | implement at least simplistic versions of name resolution, macro expansion and |
61 | resolution, macro expansion and type inference. The purpose is two | 54 | type inference. The purpose is two fold: |
62 | fold: | ||
63 | 55 | ||
64 | * to quickly bootstrap usable and useful language server: solution | 56 | * to quickly bootstrap usable and useful language server: solution that covers |
65 | that covers 80% of Rust code will be useful for IDEs, and will be | 57 | 80% of Rust code will be useful for IDEs, and will be vastly simpler than 100% |
66 | vastly simpler than 100% solution. | 58 | solution. |
67 | 59 | ||
68 | * to understand how the consumer-side of compiler API should look like | 60 | * to understand how the consumer-side of compiler API should look like |
69 | (especially it's on-demand aspects). If you have | 61 | (especially it's on-demand aspects). If you have `get_expression_type` |
70 | `get_expression_type` function, you can write a ton of purely-IDE | 62 | function, you can write a ton of purely-IDE features on top of it, even if the |
71 | features on top of it, even if the function is only partially | 63 | function is only partially correct. Pluging in the precise function afterwards |
72 | correct. Plugin in the precise function afterwards should just make | 64 | should just make IDE features more reliable. |
73 | IDE features more reliable. | 65 | |
74 | 66 | The long term plan is to merge with the mainline rustc compiler, probably around | |
75 | The long term plan is to merge with the mainline rustc compiler, | 67 | the HIR boundary? That is, use rust analyzer for parsing, macro expansion and |
76 | probably around the HIR boundary? That is, use rust analyzer for | 68 | related bits of name resolution, but leave the rest (including type inference |
77 | parsing, macro expansion and related bits of name resolution, but | 69 | and trait selection) to the existing rustc. |
78 | leave the rest (including type inference and trait selection) to the | ||
79 | existing rustc. | ||
80 | 70 | ||
81 | ## Getting in touch | 71 | ## Getting in touch |
82 | 72 | ||