@@ -874,6 +874,7 @@ pub(crate) fn handle_runnables(
874
874
if all_targets {
875
875
cargo_args. push ( "--all-targets" . to_owned ( ) ) ;
876
876
}
877
+ cargo_args. extend ( config. cargo_extra_args . iter ( ) . cloned ( ) ) ;
877
878
res. push ( lsp_ext:: Runnable {
878
879
label : format ! (
879
880
"cargo {cmd} -p {}{all_targets}" ,
@@ -887,7 +888,6 @@ pub(crate) fn handle_runnables(
887
888
cwd : cwd. into ( ) ,
888
889
override_cargo : config. override_cargo . clone ( ) ,
889
890
cargo_args,
890
- cargo_extra_args : config. cargo_extra_args . clone ( ) ,
891
891
executable_args : Vec :: new ( ) ,
892
892
environment : Default :: default ( ) ,
893
893
} ) ,
@@ -897,6 +897,8 @@ pub(crate) fn handle_runnables(
897
897
Some ( TargetSpec :: ProjectJson ( _) ) => { }
898
898
None => {
899
899
if !snap. config . linked_or_discovered_projects ( ) . is_empty ( ) {
900
+ let mut cargo_args = vec ! [ "check" . to_owned( ) , "--workspace" . to_owned( ) ] ;
901
+ cargo_args. extend ( config. cargo_extra_args . iter ( ) . cloned ( ) ) ;
900
902
res. push ( lsp_ext:: Runnable {
901
903
label : "cargo check --workspace" . to_owned ( ) ,
902
904
location : None ,
@@ -905,8 +907,7 @@ pub(crate) fn handle_runnables(
905
907
workspace_root : None ,
906
908
cwd : "." . into ( ) ,
907
909
override_cargo : config. override_cargo ,
908
- cargo_args : vec ! [ "check" . to_owned( ) , "--workspace" . to_owned( ) ] ,
909
- cargo_extra_args : config. cargo_extra_args ,
910
+ cargo_args,
910
911
executable_args : Vec :: new ( ) ,
911
912
environment : Default :: default ( ) ,
912
913
} ) ,
0 commit comments