Cleanup file structure proto handling

This commit is contained in:
Lukas Wirth 2024-10-22 10:50:23 +02:00
parent 3e02349076
commit 5e3561ea06

View File

@ -489,12 +489,12 @@ pub(crate) fn handle_document_symbol(
tags.push(SymbolTag::DEPRECATED) tags.push(SymbolTag::DEPRECATED)
}; };
#[allow(deprecated)]
let doc_symbol = lsp_types::DocumentSymbol { let doc_symbol = lsp_types::DocumentSymbol {
name: symbol.label, name: symbol.label,
detail: symbol.detail, detail: symbol.detail,
kind: to_proto::structure_node_kind(symbol.kind), kind: to_proto::structure_node_kind(symbol.kind),
tags: Some(tags), tags: Some(tags),
#[allow(deprecated)]
deprecated: Some(symbol.deprecated), deprecated: Some(symbol.deprecated),
range: to_proto::range(&line_index, symbol.node_range), range: to_proto::range(&line_index, symbol.node_range),
selection_range: to_proto::range(&line_index, symbol.navigation_range), selection_range: to_proto::range(&line_index, symbol.navigation_range),
@ -539,18 +539,11 @@ pub(crate) fn handle_document_symbol(
url: &Url, url: &Url,
res: &mut Vec<SymbolInformation>, 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 { res.push(SymbolInformation {
name: symbol.name.clone(), name: symbol.name.clone(),
kind: symbol.kind, kind: symbol.kind,
tags: Some(tags), tags: symbol.tags.clone(),
#[allow(deprecated)]
deprecated: symbol.deprecated, deprecated: symbol.deprecated,
location: Location::new(url.clone(), symbol.range), location: Location::new(url.clone(), symbol.range),
container_name, container_name,