mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Wait with change processing until the vfs is done
This commit is contained in:
parent
8286847bee
commit
c6ae9cde99
5 changed files with 34 additions and 30 deletions
|
@ -201,8 +201,8 @@ impl Vfs {
|
|||
pub fn set_file_contents(&mut self, path: VfsPath, contents: Option<Vec<u8>>) -> bool {
|
||||
let _p = span!(Level::INFO, "Vfs::set_file_contents").entered();
|
||||
let file_id = self.alloc_file_id(path);
|
||||
let state = self.get(file_id);
|
||||
let change_kind = match (state, contents) {
|
||||
let state: FileState = self.get(file_id);
|
||||
let change = match (state, contents) {
|
||||
(FileState::Deleted, None) => return false,
|
||||
(FileState::Deleted, Some(v)) => {
|
||||
let hash = hash_once::<FxHasher>(&*v);
|
||||
|
@ -225,7 +225,7 @@ impl Vfs {
|
|||
};
|
||||
};
|
||||
|
||||
let changed_file = ChangedFile { file_id, change: change_kind };
|
||||
let changed_file = ChangedFile { file_id, change };
|
||||
match self.changes.entry(file_id) {
|
||||
// two changes to the same file in one cycle, merge them appropriately
|
||||
Entry::Occupied(mut o) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue