mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-30 07:07:32 +00:00
Drag detached files towards loading
This commit is contained in:
parent
695569d978
commit
de090749d9
6 changed files with 83 additions and 11 deletions
|
@ -50,7 +50,9 @@ impl Sysroot {
|
|||
|
||||
pub fn discover(cargo_toml: &AbsPath) -> Result<Sysroot> {
|
||||
log::debug!("Discovering sysroot for {}", cargo_toml.display());
|
||||
let current_dir = cargo_toml.parent().unwrap();
|
||||
let current_dir = cargo_toml.parent().ok_or_else(|| {
|
||||
format_err!("Failed to find the parent directory for file {:?}", cargo_toml)
|
||||
})?;
|
||||
let sysroot_dir = discover_sysroot_dir(current_dir)?;
|
||||
let sysroot_src_dir = discover_sysroot_src_dir(&sysroot_dir, current_dir)?;
|
||||
let res = Sysroot::load(&sysroot_src_dir)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue