Add comments regarding workspace structure change querying

This commit is contained in:
Lukas Wirth 2024-08-10 17:04:38 +02:00
parent e219ac64c0
commit 01262d972a
3 changed files with 8 additions and 0 deletions

View File

@ -460,6 +460,11 @@ pub(crate) fn process_changes(&mut self) -> bool {
} }
} }
// FIXME: `workspace_structure_change` is computed from `should_refresh_for_change` which is
// path syntax based. That is not sufficient for all cases so we should lift that check out
// into a `QueuedTask`, see `handle_did_save_text_document`.
// Or maybe instead of replacing that check, kick off a semantic one if the syntactic one
// didn't find anything (to make up for the lack of precision).
{ {
if !matches!(&workspace_structure_change, Some((.., true))) { if !matches!(&workspace_structure_change, Some((.., true))) {
_ = self _ = self

View File

@ -158,6 +158,8 @@ pub(crate) fn handle_did_save_text_document(
.map(|cfg| cfg.files_to_watch.iter().map(String::as_str).collect::<Vec<&str>>()) .map(|cfg| cfg.files_to_watch.iter().map(String::as_str).collect::<Vec<&str>>())
.unwrap_or_default(); .unwrap_or_default();
// FIXME: We should move this check into a QueuedTask and do semantic resolution of
// the files. There is only so much we can tell syntactically from the path.
if reload::should_refresh_for_change(path, ChangeKind::Modify, additional_files) { if reload::should_refresh_for_change(path, ChangeKind::Modify, additional_files) {
state.fetch_workspaces_queue.request_op( state.fetch_workspaces_queue.request_op(
format!("workspace vfs file change saved {path}"), format!("workspace vfs file change saved {path}"),

View File

@ -105,6 +105,7 @@ pub(crate) enum Task {
FetchWorkspace(ProjectWorkspaceProgress), FetchWorkspace(ProjectWorkspaceProgress),
FetchBuildData(BuildDataProgress), FetchBuildData(BuildDataProgress),
LoadProcMacros(ProcMacroProgress), LoadProcMacros(ProcMacroProgress),
// FIXME: Remove this in favor of a more general QueuedTask, see `handle_did_save_text_document`
BuildDepsHaveChanged, BuildDepsHaveChanged,
} }