3 [![Build Status](https://travis-ci.org/rust-analyzer/rust-analyzer.svg?branch=master)](https://travis-ci.org/rust-analyzer/rust-analyzer)
5 Rust Analyzer is an **experimental** modular compiler frontend for the
6 Rust language, which aims to lay a foundation for excellent IDE
9 It doesn't implement much of compiler functionality yet, but the
10 white-space preserving Rust parser works, and there are significant
11 chunks of overall architecture (indexing, on-demand & lazy
12 computation, snapshotable world view) in place. Some basic IDE
13 functionality is provided via a language server.
15 Work on the Rust Analyzer is sponsored by
17 [![Ferrous Systems](https://ferrous-systems.com/images/ferrous-logo-text.svg)](https://ferrous-systems.com/)
22 Rust analyzer builds on Rust >= 1.30.0 (currently in beta) and uses
29 # show syntax tree of a Rust file
30 $ cargo run --package ra_cli parse < crates/ra_syntax/src/lib.rs
32 # show symbols of a Rust file
33 $ cargo run --package ra_cli symbols < crates/ra_syntax/src/lib.rs
36 To try out the language server, see [these
37 instructions](./editors/README.md). Please note that the server is not
38 ready for general use yet. If you are looking for a Rust IDE that
40 Rust](https://github.com/intellij-rust/intellij-rust) or
41 [RLS](https://github.com/rust-lang-nursery/rls). That being said, the
42 basic stuff works, and rust analyzer is developed in the rust analyzer
46 ## Current Status and Plans
48 Rust analyzer aims to fill the same niche as the official [Rust
49 Language Server](https://github.com/rust-lang-nursery/rls), but uses a
50 significantly different architecture. More details can be found [in
52 thread](https://internals.rust-lang.org/t/2019-strategy-for-rustc-and-the-rls/8361),
53 but the core issue is that RLS works in the "wait until user stops
54 typing, run the build process, save the results of the analysis" mode,
55 which arguably is the wrong foundation for IDE.
57 Rust Analyzer is a hobby project at the moment, there's exactly zero
58 guarantees that it becomes production-ready one day.
60 The near/mid term plan is to work independently of the main rustc
61 compiler and implement at least simplistic versions of name
62 resolution, macro expansion and type inference. The purpose is two
65 * to quickly bootstrap usable and useful language server: solution
66 that covers 80% of Rust code will be useful for IDEs, and will be
67 vastly simpler than 100% solution.
69 * to understand how the consumer-side of compiler API should look like
70 (especially it's on-demand aspects). If you have
71 `get_expression_type` function, you can write a ton of purely-IDE
72 features on top of it, even if the function is only partially
73 correct. Plugin in the precise function afterwards should just make
74 IDE features more reliable.
76 The long term plan is to merge with the mainline rustc compiler,
77 probably around the HIR boundary? That is, use rust analyzer for
78 parsing, macro expansion and related bits of name resolution, but
79 leave the rest (including type inference and trait selection) to the
84 We have a Discord server dedicated to compilers and language servers
85 implemented in Rust: [https://discord.gg/sx3RQZB](https://discord.gg/sx3RQZB).
89 See [CONTRIBUTING.md](./CONTRIBUTING.md) and [ARCHITECTURE.md](./ARCHITECTURE.md)
94 Rust analyzer is primarily distributed under the terms of both the MIT
95 license and the Apache License (Version 2.0).
97 See LICENSE-APACHE and LICENSE-MIT for details.