Skip to content

Commit

Permalink
LSP: record dependencies and invalid all dependents when a dependenci…
Browse files Browse the repository at this point in the history
…es changes

Fixes #5797
  • Loading branch information
ogoffart committed Nov 14, 2024
1 parent cde5133 commit 5b3ea5c
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 133 deletions.
3 changes: 2 additions & 1 deletion internal/compiler/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::path::{Path, PathBuf};
use std::rc::Rc;

use crate::parser::TextSize;
use std::collections::BTreeSet;

/// Span represent an error location within a file.
///
Expand Down Expand Up @@ -299,7 +300,7 @@ pub struct BuildDiagnostics {
/// does not include the main file.
/// FIXME: this doesn't really belong in the diagnostics, it should be somehow returned in another way
/// (maybe in a compilation state that include the diagnostics?)
pub all_loaded_files: Vec<PathBuf>,
pub all_loaded_files: BTreeSet<PathBuf>,
}

impl IntoIterator for BuildDiagnostics {
Expand Down
3 changes: 0 additions & 3 deletions internal/compiler/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ pub async fn compile_syntax_node(
// Don't run all the passes in case of errors because because some invariants are not met.
passes::run_import_passes(&doc, &loader, &mut diagnostics);
}

diagnostics.all_loaded_files = loader.all_files().cloned().collect();

(doc, diagnostics, loader)
}

Expand Down
Loading

0 comments on commit 5b3ea5c

Please sign in to comment.