Skip to content

Commit cd8522e

Browse files
committed
Use empty SymbolInformation.signature_documentation.relative_path
I'm fairly sure this is more correct, and saves space(~90mb to 82mb for Zed's index). I'm checking in about this with SCIP folks in sourcegraph/scip#299.
1 parent bbc6242 commit cd8522e

File tree

1 file changed

+2
-9
lines changed
  • src/tools/rust-analyzer/crates/rust-analyzer/src/cli

1 file changed

+2
-9
lines changed

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

+2-9
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ impl flags::Scip {
151151
text_range,
152152
);
153153
symbols.push(compute_symbol_info(
154-
relative_path.clone(),
155154
symbol.clone(),
156155
enclosing_symbol,
157156
token,
@@ -238,12 +237,7 @@ impl flags::Scip {
238237
&line_index,
239238
text_range,
240239
);
241-
external_symbols.push(compute_symbol_info(
242-
relative_path.clone(),
243-
symbol.clone(),
244-
enclosing_symbol,
245-
token,
246-
));
240+
external_symbols.push(compute_symbol_info(symbol.clone(), enclosing_symbol, token));
247241
}
248242

249243
let index = scip_types::Index {
@@ -289,7 +283,6 @@ Duplicate symbols encountered:
289283
";
290284

291285
fn compute_symbol_info(
292-
relative_path: String,
293286
symbol: String,
294287
enclosing_symbol: Option<String>,
295288
token: &TokenStaticData,
@@ -301,7 +294,7 @@ fn compute_symbol_info(
301294

302295
let position_encoding = scip_types::PositionEncoding::UTF8CodeUnitOffsetFromLineStart.into();
303296
let signature_documentation = token.signature.clone().map(|text| scip_types::Document {
304-
relative_path,
297+
relative_path: "".to_owned(),
305298
language: "rust".to_owned(),
306299
text,
307300
position_encoding,

0 commit comments

Comments
 (0)