File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -201,11 +201,14 @@ impl GlobalState {
201
201
let mut crate_graph = CrateGraph :: default ( ) ;
202
202
let vfs = & mut self . vfs . write ( ) . 0 ;
203
203
let loader = & mut self . loader ;
204
+ let mem_docs = & self . mem_docs ;
204
205
let mut load = |path : & AbsPath | {
205
- let contents = loader. handle . load_sync ( path) ;
206
- let path = vfs:: VfsPath :: from ( path. to_path_buf ( ) ) ;
207
- vfs. set_file_contents ( path. clone ( ) , contents) ;
208
- vfs. file_id ( & path)
206
+ let vfs_path = vfs:: VfsPath :: from ( path. to_path_buf ( ) ) ;
207
+ if !mem_docs. contains_key ( & vfs_path) {
208
+ let contents = loader. handle . load_sync ( path) ;
209
+ vfs. set_file_contents ( vfs_path. clone ( ) , contents) ;
210
+ }
211
+ vfs. file_id ( & vfs_path)
209
212
} ;
210
213
for ws in workspaces. iter ( ) {
211
214
crate_graph. extend ( ws. to_crate_graph (
You can’t perform that action at this time.
0 commit comments