Skip to main content

Module reload

Module reload 

Source
Expand description

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, 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.

Enums§

BuildDataProgress 🔒
ProcMacroProgress 🔒
ProjectWorkspaceProgress 🔒

Functions§

eq_ignore_underscore 🔒
Similar to str::eq_ignore_ascii_case but instead of ignoring case, we say that - and _ are equal.
should_refresh_for_change 🔒
ws_to_crate_graph