Skip to content

Commit

Permalink
Use empty SymbolInformation.signature_documentation.relative_path
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mgsloan committed Dec 26, 2024
1 parent 124c831 commit d650daa
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions crates/rust-analyzer/src/cli/scip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ impl flags::Scip {
text_range,
);
symbols.push(compute_symbol_info(
relative_path.clone(),
symbol.clone(),
enclosing_symbol,
token,
Expand Down Expand Up @@ -238,12 +237,7 @@ impl flags::Scip {
&line_index,
text_range,
);
external_symbols.push(compute_symbol_info(
relative_path.clone(),
symbol.clone(),
enclosing_symbol,
token,
));
external_symbols.push(compute_symbol_info(symbol.clone(), enclosing_symbol, token));
}

let index = scip_types::Index {
Expand Down Expand Up @@ -289,7 +283,6 @@ Duplicate symbols encountered:
";

fn compute_symbol_info(
relative_path: String,
symbol: String,
enclosing_symbol: Option<String>,
token: &TokenStaticData,
Expand All @@ -301,7 +294,7 @@ fn compute_symbol_info(

let position_encoding = scip_types::PositionEncoding::UTF8CodeUnitOffsetFromLineStart.into();
let signature_documentation = token.signature.clone().map(|text| scip_types::Document {
relative_path,
relative_path: "".to_owned(),
language: "rust".to_owned(),
text,
position_encoding,
Expand Down

0 comments on commit d650daa

Please sign in to comment.