From d650daa7d3f20eb660d8585ba945628a317283ca Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Thu, 26 Dec 2024 01:50:12 -0700 Subject: [PATCH] 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 https://github.com/sourcegraph/scip/pull/299. --- crates/rust-analyzer/src/cli/scip.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/crates/rust-analyzer/src/cli/scip.rs b/crates/rust-analyzer/src/cli/scip.rs index 6526fd965a..e096f3f518 100644 --- a/crates/rust-analyzer/src/cli/scip.rs +++ b/crates/rust-analyzer/src/cli/scip.rs @@ -151,7 +151,6 @@ impl flags::Scip { text_range, ); symbols.push(compute_symbol_info( - relative_path.clone(), symbol.clone(), enclosing_symbol, token, @@ -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 { @@ -289,7 +283,6 @@ Duplicate symbols encountered: "; fn compute_symbol_info( - relative_path: String, symbol: String, enclosing_symbol: Option, token: &TokenStaticData, @@ -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,