File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
- //! Project loading & configuration updates
1
+ //! Project loading & configuration updates.
2
+ //!
3
+ //! This is quite tricky. The main problem is time and changes -- there's no
4
+ //! fixed "project" rust-analyzer is working with, "current project" is itself
5
+ //! mutable state. For example, when the user edits `Cargo.toml` by adding a new
6
+ //! dependency, project model changes. What's more, switching project model is
7
+ //! not instantaneous -- it takes time to run `cargo metadata` and (for proc
8
+ //! macros) `cargo check`.
9
+ //!
10
+ //! The main guiding principle here is, as elsewhere in rust-analyzer, is
11
+ //! robustness. We try not to assume that the project model exists or is
12
+ //! correct. Instead, we try to provide a best-effort service. Even if the
13
+ //! project is currently loading and we don't have a full project model, we
14
+ //! still want to respond to various requests.
2
15
use std:: { mem, sync:: Arc } ;
3
16
4
17
use flycheck:: { FlycheckConfig , FlycheckHandle } ;
You can’t perform that action at this time.
0 commit comments