From 07a4b9f1a0c36c6bff4b0dbaaeaa93baea8b1f0e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 26 Jan 2019 15:41:52 +0300 Subject: dont overwrite memfies --- crates/ra_vfs/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_vfs/src/lib.rs') diff --git a/crates/ra_vfs/src/lib.rs b/crates/ra_vfs/src/lib.rs index d1b0222e7..70a13f765 100644 --- a/crates/ra_vfs/src/lib.rs +++ b/crates/ra_vfs/src/lib.rs @@ -264,7 +264,9 @@ impl Vfs { self.pending_changes.push(change); } TaskResult::AddSingleFile { root, path, text } => { - self.do_add_file(root, path, text, false); + if self.find_file(root, &path).is_none() { + self.do_add_file(root, path, text, false); + } } TaskResult::ChangeSingleFile { root, path, text } => { if let Some(file) = self.find_file(root, &path) { -- cgit v1.2.3