From 5e3561ea065c73dc38ca92b5095fc9e6f43e4eaa Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 22 Oct 2024 10:50:23 +0200 Subject: [PATCH] Cleanup file structure proto handling --- .../crates/rust-analyzer/src/handlers/request.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs index a9f8ac3a80a6b..998b3b49012cb 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs @@ -489,12 +489,12 @@ pub(crate) fn handle_document_symbol( tags.push(SymbolTag::DEPRECATED) }; - #[allow(deprecated)] let doc_symbol = lsp_types::DocumentSymbol { name: symbol.label, detail: symbol.detail, kind: to_proto::structure_node_kind(symbol.kind), tags: Some(tags), + #[allow(deprecated)] deprecated: Some(symbol.deprecated), range: to_proto::range(&line_index, symbol.node_range), selection_range: to_proto::range(&line_index, symbol.navigation_range), @@ -539,18 +539,11 @@ pub(crate) fn handle_document_symbol( url: &Url, res: &mut Vec, ) { - let mut tags = Vec::new(); - - #[allow(deprecated)] - if let Some(true) = symbol.deprecated { - tags.push(SymbolTag::DEPRECATED) - } - - #[allow(deprecated)] res.push(SymbolInformation { name: symbol.name.clone(), kind: symbol.kind, - tags: Some(tags), + tags: symbol.tags.clone(), + #[allow(deprecated)] deprecated: symbol.deprecated, location: Location::new(url.clone(), symbol.range), container_name,