diff options
author | Aleksey Kladov <[email protected]> | 2018-09-16 12:29:34 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-09-16 12:29:34 +0100 |
commit | cc76b0d31d8ba013c499dd3a4ca69b37004795e6 (patch) | |
tree | d83c46b8774ceee93467e1da942d511b7be4b390 | |
parent | b5021411a84822cb3f1e3aeffad9550dd15bdeb6 (diff) |
Update readme
-rw-r--r-- | README.md | 54 |
1 files changed, 47 insertions, 7 deletions
@@ -1,13 +1,18 @@ | |||
1 | # libsyntax2.0 | 1 | # Rust Analyzer |
2 | 2 | ||
3 | [![Build Status](https://travis-ci.org/matklad/libsyntax2.svg?branch=master)](https://travis-ci.org/matklad/libsyntax2) | 3 | [![Build Status](https://travis-ci.org/matklad/rust-analyzer.svg?branch=master)](https://travis-ci.org/matklad/rust-analyzer) |
4 | [![Build status](https://ci.appveyor.com/api/projects/status/j56x1hbje8rdg6xk/branch/master?svg=true)](https://ci.appveyor.com/project/matklad/libsyntax2/branch/master) | 4 | [![Build status](https://ci.appveyor.com/api/projects/status/j56x1hbje8rdg6xk/branch/master?svg=true)](https://ci.appveyor.com/project/matklad/rust-analyzer/branch/master) |
5 | 5 | ||
6 | 6 | ||
7 | libsyntax2.0 is an **experimental** parser of the Rust language, | 7 | Rust Analyzer is an **experimental** modular compiler frontend for the |
8 | intended for the use in IDEs. | 8 | Rust language, which aims to lay a foundation for excellent IDE |
9 | [RFC](https://github.com/rust-lang/rfcs/pull/2256). | 9 | support. |
10 | 10 | ||
11 | It doesn't implement much of compiler functionality yet, but the | ||
12 | white-space preserving Rust parser works, and there are significant | ||
13 | chunks of overall architecture (indexing, on-demand & lazy | ||
14 | computation, snapshotable world view) in place. Some basic IDE | ||
15 | functionality is provided via a language server. | ||
11 | 16 | ||
12 | ## Quick Start | 17 | ## Quick Start |
13 | 18 | ||
@@ -16,7 +21,6 @@ $ cargo test | |||
16 | $ cargo parse < crates/libsyntax2/src/lib.rs | 21 | $ cargo parse < crates/libsyntax2/src/lib.rs |
17 | ``` | 22 | ``` |
18 | 23 | ||
19 | |||
20 | ## Trying It Out | 24 | ## Trying It Out |
21 | 25 | ||
22 | This installs experimental VS Code plugin | 26 | This installs experimental VS Code plugin |
@@ -61,6 +65,42 @@ doesn't hurt too much :-) | |||
61 | 65 | ||
62 | * **Go to definition** ("correct" for `mod foo;` decls, index-based for functions). | 66 | * **Go to definition** ("correct" for `mod foo;` decls, index-based for functions). |
63 | 67 | ||
68 | ## Current Status and Plans | ||
69 | |||
70 | Rust analyzer aims to fill the same niche as the official [Rust | ||
71 | Language Server](https://github.com/rust-lang-nursery/rls), but | ||
72 | better. It was created because @matklad is not satisfied with RLS | ||
73 | original starting point and current direction. More details can be | ||
74 | found [in this | ||
75 | thread](https://internals.rust-lang.org/t/2019-strategy-for-rustc-and-the-rls/8361). | ||
76 | The core issue is that RLS works in the "wait until user stops typing, | ||
77 | run the build process, save the results of the analysis" mode, which | ||
78 | arguably is the wrong foundation for IDE (see the thread for details). | ||
79 | |||
80 | Rust Analyzer is a hobby project at the moment, there's exactly zero | ||
81 | guarantees that it becomes production-ready one day. | ||
82 | |||
83 | The near/mid term plan is to work independently of the main rustc | ||
84 | compiler and implement at least simplistic versions of name | ||
85 | resolution, macro expansion and type inference. The purpose is two | ||
86 | fold: | ||
87 | |||
88 | * to quickly bootstrap usable and useful language server: solution | ||
89 | that covers 80% of Rust code will be useful for IDEs, and will be | ||
90 | vastly simpler than 100% solution. | ||
91 | |||
92 | * to understand how the consumer-side of compiler API should look like | ||
93 | (especially it's on-demand aspects). If you have | ||
94 | `get_expression_type` function, you can write a ton of purely-IDE | ||
95 | features on top of it, even if the function is only partially | ||
96 | correct. Plugin in the precise function afterwards should just make | ||
97 | IDE features more reliable. | ||
98 | |||
99 | The long term plan is to merge with the mainline rustc compiler, | ||
100 | probably around the HIR boundary? That is, use rust analyzer for | ||
101 | parsing, macro expansion and related bits of name resolution, but | ||
102 | leave the rest (including type inference and trait selection) to the | ||
103 | existing rustc. | ||
64 | 104 | ||
65 | ## Code Walk-Through | 105 | ## Code Walk-Through |
66 | 106 | ||