mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
feat: Make rust-analyzer work partially when missing an internet connection
This commit is contained in:
parent
07659783fd
commit
07c1b83e98
4 changed files with 75 additions and 17 deletions
|
@ -441,14 +441,15 @@ impl ProjectWorkspace {
|
|||
) -> anyhow::Result<WorkspaceBuildScripts> {
|
||||
match &self.kind {
|
||||
ProjectWorkspaceKind::DetachedFile { cargo: Some((cargo, _)), .. }
|
||||
| ProjectWorkspaceKind::Cargo { cargo, .. } => {
|
||||
| ProjectWorkspaceKind::Cargo { cargo, .. }
|
||||
if !cargo.no_deps() =>
|
||||
{
|
||||
WorkspaceBuildScripts::run_for_workspace(config, cargo, progress, &self.sysroot)
|
||||
.with_context(|| {
|
||||
format!("Failed to run build scripts for {}", cargo.workspace_root())
|
||||
})
|
||||
}
|
||||
ProjectWorkspaceKind::DetachedFile { cargo: None, .. }
|
||||
| ProjectWorkspaceKind::Json { .. } => Ok(WorkspaceBuildScripts::default()),
|
||||
_ => Ok(WorkspaceBuildScripts::default()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue