Unnamed repository; edit this file 'description' to name the repository.
Cleanup file structure proto handling
Lukas Wirth 2024-10-22
parent 8214170 · commit 2324324
-rw-r--r--crates/rust-analyzer/src/handlers/request.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/crates/rust-analyzer/src/handlers/request.rs b/crates/rust-analyzer/src/handlers/request.rs
index a9f8ac3a80..998b3b4901 100644
--- a/crates/rust-analyzer/src/handlers/request.rs
+++ b/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,