Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 615aaa4

Browse files
committed
Auto merge of rust-lang#14894 - Wilfred:index_scip_path, r=lnicola
Allow users to override the .scip output file path Previously, rust-analyzer would write to the file index.scip unconditionally.
2 parents 06d02e0 + 5b0e170 commit 615aaa4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

crates/rust-analyzer/src/cli/flags.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ xflags::xflags! {
112112

113113
cmd scip {
114114
required path: PathBuf
115+
116+
/// The output path where the SCIP file will be written to. Defaults to `index.scip`.
117+
optional --output path: PathBuf
115118
}
116119
}
117120
}
@@ -208,6 +211,7 @@ pub struct Lsif {
208211
#[derive(Debug)]
209212
pub struct Scip {
210213
pub path: PathBuf,
214+
pub output: Option<PathBuf>,
211215
}
212216

213217
impl RustAnalyzer {

crates/rust-analyzer/src/cli/scip.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
use std::{
44
collections::{HashMap, HashSet},
5+
path::PathBuf,
56
time::Instant,
67
};
78

@@ -165,7 +166,8 @@ impl flags::Scip {
165166
special_fields: Default::default(),
166167
};
167168

168-
scip::write_message_to_file("index.scip", index)
169+
let out_path = self.output.unwrap_or_else(|| PathBuf::from(r"index.scip"));
170+
scip::write_message_to_file(out_path, index)
169171
.map_err(|err| anyhow::anyhow!("Failed to write scip to file: {}", err))?;
170172

171173
eprintln!("Generating SCIP finished {:?}", now.elapsed());

0 commit comments

Comments
 (0)