Skip to content

Commit f1e2371

Browse files
committed
minor changes
1 parent d5cfeb5 commit f1e2371

File tree

1 file changed

+8
-6
lines changed
  • src/tools/rust-analyzer/crates/load-cargo/src

1 file changed

+8
-6
lines changed

src/tools/rust-analyzer/crates/load-cargo/src/lib.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)