File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/tools/rust-analyzer/crates/load-cargo/src Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -243,23 +243,25 @@ impl ProjectFolders {
243243 for ws in workspaces. iter ( ) {
244244 let mut file_set_roots: Vec < VfsPath > = vec ! [ ] ;
245245 let mut entries = vec ! [ ] ;
246- let mut register = false ;
247246
248247 if let Some ( manifest) = ws. manifest ( ) . map ( ManifestPath :: as_ref) {
249248 file_set_roots. push ( VfsPath :: from ( manifest. to_owned ( ) ) ) ;
250249 entries. push ( manifest. to_owned ( ) ) ;
251- register = true ;
252250 }
253251
254252 // In case of detached files we do **not** look for a rust-analyzer.toml.
255253 if !matches ! ( ws. kind, ProjectWorkspaceKind :: DetachedFile { .. } ) {
256254 let ws_root = ws. workspace_root ( ) ;
257- file_set_roots. push ( VfsPath :: from ( ws_root. to_owned ( ) ) ) ;
258- entries. push ( ws_root. to_owned ( ) ) ;
259- register = true ;
255+ let ratoml_path = {
256+ let mut p = ws_root. to_path_buf ( ) ;
257+ p. push ( "rust-analyzer.toml" ) ;
258+ p
259+ } ;
260+ file_set_roots. push ( VfsPath :: from ( ratoml_path. to_owned ( ) ) ) ;
261+ entries. push ( ratoml_path. to_owned ( ) ) ;
260262 }
261263
262- if register {
264+ if !file_set_roots . is_empty ( ) {
263265 let entry = vfs:: loader:: Entry :: Files ( entries) ;
264266 res. watch . push ( res. load . len ( ) ) ;
265267 res. load . push ( entry) ;
You can’t perform that action at this time.
0 commit comments