]> git.lizzy.rs Git - rust.git/blob - README.md
Corrected the readme on debugging
[rust.git] / README.md
1 # Rust Analyzer
2
3 [![Build Status](https://travis-ci.org/rust-analyzer/rust-analyzer.svg?branch=master)](https://travis-ci.org/rust-analyzer/rust-analyzer)
4
5 Rust Analyzer is an **experimental** modular compiler frontend for the Rust
6 language, which aims to lay a foundation for excellent IDE support.
7
8 It doesn't implement much of compiler functionality yet, but the white-space
9 preserving Rust parser works, and there are significant chunks of overall
10 architecture (indexing, on-demand & lazy computation, snapshotable world view)
11 in place. Some basic IDE functionality is provided via a language server.
12
13 Work on the Rust Analyzer is sponsored by
14
15 [![Ferrous Systems](https://ferrous-systems.com/images/ferrous-logo-text.svg)](https://ferrous-systems.com/)
16
17 ## Quick Start
18
19 Rust analyzer builds on Rust >= 1.31.0 and uses the 2018 edition.
20
21 ```
22 # run tests
23 $ cargo test
24
25 # show syntax tree of a Rust file
26 $ cargo run --package ra_cli parse < crates/ra_syntax/src/lib.rs
27
28 # show symbols of a Rust file
29 $ cargo run --package ra_cli symbols < crates/ra_syntax/src/lib.rs
30
31 # install the language server
32 $ cargo install --path crates/ra_lsp_server
33 ```
34
35 See [these instructions](./editors/README.md) for VS Code setup and the list of
36 features (some of which are VS Code specific).
37
38 ## Debugging
39
40 See [these instructions](./DEBUGGING.md) on how to debug the vscode extension and the lsp server.
41
42 ## Current Status and Plans
43
44 Rust analyzer aims to fill the same niche as the official [Rust Language
45 Server](https://github.com/rust-lang-nursery/rls), but uses a significantly
46 different architecture. More details can be found [in this
47 thread](https://internals.rust-lang.org/t/2019-strategy-for-rustc-and-the-rls/8361),
48 but the core issue is that RLS works in the "wait until user stops typing, run
49 the build process, save the results of the analysis" mode, which arguably is the
50 wrong foundation for IDE.
51
52 Rust Analyzer is an experimental project at the moment, there's exactly zero
53 guarantees that it becomes production-ready one day.
54
55 The near/mid term plan is to work independently of the main rustc compiler and
56 implement at least simplistic versions of name resolution, macro expansion and
57 type inference. The purpose is two fold:
58
59 - to quickly bootstrap usable and useful language server: solution that covers
60   80% of Rust code will be useful for IDEs, and will be vastly simpler than 100%
61   solution.
62
63 - to understand how the consumer-side of compiler API should look like
64   (especially it's on-demand aspects). If you have `get_expression_type`
65   function, you can write a ton of purely-IDE features on top of it, even if the
66   function is only partially correct. Pluging in the precise function afterwards
67   should just make IDE features more reliable.
68
69 The long term plan is to merge with the mainline rustc compiler, probably around
70 the HIR boundary? That is, use rust analyzer for parsing, macro expansion and
71 related bits of name resolution, but leave the rest (including type inference
72 and trait selection) to the existing rustc.
73
74 ## Getting in touch
75
76 We have a Discord server dedicated to compilers and language servers
77 implemented in Rust: [https://discord.gg/sx3RQZB](https://discord.gg/sx3RQZB).
78
79 ## Contributing
80
81 See [CONTRIBUTING.md](./CONTRIBUTING.md) and [ARCHITECTURE.md](./ARCHITECTURE.md)
82
83 ## License
84
85 Rust analyzer is primarily distributed under the terms of both the MIT
86 license and the Apache License (Version 2.0).
87
88 See LICENSE-APACHE and LICENSE-MIT for details.