Skip to content

Commit 01262d9

Browse files
committed
Add comments regarding workspace structure change querying
1 parent e219ac6 commit 01262d9

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/global_state.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,11 @@ impl GlobalState {
460460
}
461461
}
462462

463+
// FIXME: `workspace_structure_change` is computed from `should_refresh_for_change` which is
464+
// path syntax based. That is not sufficient for all cases so we should lift that check out
465+
// into a `QueuedTask`, see `handle_did_save_text_document`.
466+
// Or maybe instead of replacing that check, kick off a semantic one if the syntactic one
467+
// didn't find anything (to make up for the lack of precision).
463468
{
464469
if !matches!(&workspace_structure_change, Some((.., true))) {
465470
_ = self

src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/notification.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ pub(crate) fn handle_did_save_text_document(
158158
.map(|cfg| cfg.files_to_watch.iter().map(String::as_str).collect::<Vec<&str>>())
159159
.unwrap_or_default();
160160

161+
// FIXME: We should move this check into a QueuedTask and do semantic resolution of
162+
// the files. There is only so much we can tell syntactically from the path.
161163
if reload::should_refresh_for_change(path, ChangeKind::Modify, additional_files) {
162164
state.fetch_workspaces_queue.request_op(
163165
format!("workspace vfs file change saved {path}"),

src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ pub(crate) enum Task {
105105
FetchWorkspace(ProjectWorkspaceProgress),
106106
FetchBuildData(BuildDataProgress),
107107
LoadProcMacros(ProcMacroProgress),
108+
// FIXME: Remove this in favor of a more general QueuedTask, see `handle_did_save_text_document`
108109
BuildDepsHaveChanged,
109110
}
110111

0 commit comments

Comments
 (0)