mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
minor changes
This commit is contained in:
parent
e0db833082
commit
af88940dca
1 changed files with 8 additions and 6 deletions
|
@ -243,23 +243,25 @@ impl ProjectFolders {
|
||||||
for ws in workspaces.iter() {
|
for ws in workspaces.iter() {
|
||||||
let mut file_set_roots: Vec<VfsPath> = vec![];
|
let mut file_set_roots: Vec<VfsPath> = vec![];
|
||||||
let mut entries = vec![];
|
let mut entries = vec![];
|
||||||
let mut register = false;
|
|
||||||
|
|
||||||
if let Some(manifest) = ws.manifest().map(ManifestPath::as_ref) {
|
if let Some(manifest) = ws.manifest().map(ManifestPath::as_ref) {
|
||||||
file_set_roots.push(VfsPath::from(manifest.to_owned()));
|
file_set_roots.push(VfsPath::from(manifest.to_owned()));
|
||||||
entries.push(manifest.to_owned());
|
entries.push(manifest.to_owned());
|
||||||
register = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// In case of detached files we do **not** look for a rust-analyzer.toml.
|
// In case of detached files we do **not** look for a rust-analyzer.toml.
|
||||||
if !matches!(ws.kind, ProjectWorkspaceKind::DetachedFile { .. }) {
|
if !matches!(ws.kind, ProjectWorkspaceKind::DetachedFile { .. }) {
|
||||||
let ws_root = ws.workspace_root();
|
let ws_root = ws.workspace_root();
|
||||||
file_set_roots.push(VfsPath::from(ws_root.to_owned()));
|
let ratoml_path = {
|
||||||
entries.push(ws_root.to_owned());
|
let mut p = ws_root.to_path_buf();
|
||||||
register = true;
|
p.push("rust-analyzer.toml");
|
||||||
|
p
|
||||||
|
};
|
||||||
|
file_set_roots.push(VfsPath::from(ratoml_path.to_owned()));
|
||||||
|
entries.push(ratoml_path.to_owned());
|
||||||
}
|
}
|
||||||
|
|
||||||
if register {
|
if !file_set_roots.is_empty() {
|
||||||
let entry = vfs::loader::Entry::Files(entries);
|
let entry = vfs::loader::Entry::Files(entries);
|
||||||
res.watch.push(res.load.len());
|
res.watch.push(res.load.len());
|
||||||
res.load.push(entry);
|
res.load.push(entry);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue