about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2024-10-22 10:50:23 +0200
committerLukas Wirth <lukastw97@gmail.com>2024-10-22 10:51:08 +0200
commit5e3561ea065c73dc38ca92b5095fc9e6f43e4eaa (patch)
treec4ef98eea42c8b4503a702cf4c002a06c9dbc5ae /src
parent3e02349076ddb68cc694b3555c73113c1983edb8 (diff)
downloadrust-5e3561ea065c73dc38ca92b5095fc9e6f43e4eaa.tar.gz
rust-5e3561ea065c73dc38ca92b5095fc9e6f43e4eaa.zip
Cleanup file structure proto handling
Diffstat (limited to 'src')
-rw-r--r--src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs13
1 files 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 a9f8ac3a80a..998b3b49012 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<SymbolInformation>,
     ) {
-        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,