3 [![Build Status](https://travis-ci.org/rust-analyzer/rust-analyzer.svg?branch=master)](https://travis-ci.org/rust-analyzer/rust-analyzer)
4 [![Build status](https://ci.appveyor.com/api/projects/status/vtt455oi3hjy9uvk/branch/master?svg=true)](https://ci.appveyor.com/project/matklad/rust-analyzer/branch/master)
7 Rust Analyzer is an **experimental** modular compiler frontend for the
8 Rust language, which aims to lay a foundation for excellent IDE
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.
17 Work on the Rust Analyzer is sponsored by
19 [![Ferrous Systems](https://ferrous-systems.com/images/ferrous-logo-text.svg)](https://ferrous-systems.com/)
24 Rust analyzer builds on Rust >= 1.30.0 (currently in beta) and uses
31 # show syntax tree of a Rust file
32 $ cargo run --package ra_cli parse < crates/ra_syntax/src/lib.rs
34 # show symbols of a Rust file
35 $ cargo run --package ra_cli symbols < crates/ra_syntax/src/lib.rs
38 To try out the language server, see [these
39 instructions](./editors/README.md). Please note that the server is not
40 ready for general use yet. If you are looking for a Rust IDE that
42 Rust](https://github.com/intellij-rust/intellij-rust) or
43 [RLS](https://github.com/rust-lang-nursery/rls). That being said, the
44 basic stuff works, and rust analyzer is developed in the rust analyzer
48 ## Current Status and Plans
50 Rust analyzer aims to fill the same niche as the official [Rust
51 Language Server](https://github.com/rust-lang-nursery/rls), but uses a
52 significantly different architecture. More details can be found [in
54 thread](https://internals.rust-lang.org/t/2019-strategy-for-rustc-and-the-rls/8361),
55 but the core issue is that RLS works in the "wait until user stops
56 typing, run the build process, save the results of the analysis" mode,
57 which arguably is the wrong foundation for IDE.
59 Rust Analyzer is a hobby project at the moment, there's exactly zero
60 guarantees that it becomes production-ready one day.
62 The near/mid term plan is to work independently of the main rustc
63 compiler and implement at least simplistic versions of name
64 resolution, macro expansion and type inference. The purpose is two
67 * to quickly bootstrap usable and useful language server: solution
68 that covers 80% of Rust code will be useful for IDEs, and will be
69 vastly simpler than 100% solution.
71 * to understand how the consumer-side of compiler API should look like
72 (especially it's on-demand aspects). If you have
73 `get_expression_type` function, you can write a ton of purely-IDE
74 features on top of it, even if the function is only partially
75 correct. Plugin in the precise function afterwards should just make
76 IDE features more reliable.
78 The long term plan is to merge with the mainline rustc compiler,
79 probably around the HIR boundary? That is, use rust analyzer for
80 parsing, macro expansion and related bits of name resolution, but
81 leave the rest (including type inference and trait selection) to the
86 We have a Discord server dedicated to compilers and language servers
87 implemented in Rust: [https://discord.gg/sx3RQZB](https://discord.gg/sx3RQZB).
91 See [CONTRIBUTING.md](./CONTRIBUTING.md) and [ARCHITECTURE.md](./ARCHITECTURE.md)
96 Rust analyzer is primarily distributed under the terms of both the MIT
97 license and the Apache License (Version 2.0).
99 See LICENSE-APACHE and LICENSE-MIT for details.