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 {
243
243
for ws in workspaces. iter ( ) {
244
244
let mut file_set_roots: Vec < VfsPath > = vec ! [ ] ;
245
245
let mut entries = vec ! [ ] ;
246
- let mut register = false ;
247
246
248
247
if let Some ( manifest) = ws. manifest ( ) . map ( ManifestPath :: as_ref) {
249
248
file_set_roots. push ( VfsPath :: from ( manifest. to_owned ( ) ) ) ;
250
249
entries. push ( manifest. to_owned ( ) ) ;
251
- register = true ;
252
250
}
253
251
254
252
// In case of detached files we do **not** look for a rust-analyzer.toml.
255
253
if !matches ! ( ws. kind, ProjectWorkspaceKind :: DetachedFile { .. } ) {
256
254
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 ( ) ) ;
260
262
}
261
263
262
- if register {
264
+ if !file_set_roots . is_empty ( ) {
263
265
let entry = vfs:: loader:: Entry :: Files ( entries) ;
264
266
res. watch . push ( res. load . len ( ) ) ;
265
267
res. load . push ( entry) ;
You can’t perform that action at this time.
0 commit comments