Skip to content

Commit

Permalink
Auto merge of rust-lang#12337 - matklad:docz, r=matklad
Browse files Browse the repository at this point in the history
internal: document overall approach to reload
  • Loading branch information
bors committed May 21, 2022
2 parents 1182387 + cbdab0e commit 49ffde4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion crates/rust-analyzer/src/reload.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
//! Project loading & configuration updates
//! Project loading & configuration updates.
//!
//! This is quite tricky. The main problem is time and changes -- there's no
//! fixed "project" rust-analyzer is working with, "current project" is itself
//! mutable state. For example, when the user edits `Cargo.toml` by adding a new
//! dependency, project model changes. What's more, switching project model is
//! not instantaneous -- it takes time to run `cargo metadata` and (for proc
//! macros) `cargo check`.
//!
//! The main guiding principle here is, as elsewhere in rust-analyzer, is
//! robustness. We try not to assume that the project model exists or is
//! correct. Instead, we try to provide a best-effort service. Even if the
//! project is currently loading and we don't have a full project model, we
//! still want to respond to various requests.
use std::{mem, sync::Arc};

use flycheck::{FlycheckConfig, FlycheckHandle};
Expand Down

0 comments on commit 49ffde4

Please sign in to comment.