mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Pass required features to cargo when using run action
When using `F1`->`Rust Analyzer: Run` action on an `example`, pass its `required-features` to `cargo run`. This allows to run examples that were otherwise impossible to run with RA.
This commit is contained in:
parent
ba33054802
commit
662dd7c27d
2 changed files with 21 additions and 4 deletions
|
@ -210,6 +210,8 @@ pub struct TargetData {
|
|||
pub kind: TargetKind,
|
||||
/// Is this target a proc-macro
|
||||
pub is_proc_macro: bool,
|
||||
/// Required features of the target without which it won't build
|
||||
pub required_features: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
|
@ -348,6 +350,7 @@ impl CargoWorkspace {
|
|||
root: AbsPathBuf::assert(PathBuf::from(&meta_tgt.src_path)),
|
||||
kind: TargetKind::new(meta_tgt.kind.as_slice()),
|
||||
is_proc_macro,
|
||||
required_features: meta_tgt.required_features.clone(),
|
||||
});
|
||||
pkg_data.targets.push(tgt);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue