@@ -15,7 +15,7 @@ use lsp_types::{
15
15
DocumentHighlight , DocumentSymbol , FoldingRange , FoldingRangeParams , HoverContents , Location ,
16
16
Position , PrepareRenameResponse , Range , RenameParams , SemanticTokensParams ,
17
17
SemanticTokensRangeParams , SemanticTokensRangeResult , SemanticTokensResult , SymbolInformation ,
18
- TextDocumentIdentifier , Url , WorkspaceEdit ,
18
+ SymbolTag , TextDocumentIdentifier , Url , WorkspaceEdit ,
19
19
} ;
20
20
use ra_ide:: {
21
21
FileId , FilePosition , FileRange , HoverAction , HoverGotoTypeData , NavigationTarget , Query ,
@@ -253,10 +253,17 @@ pub(crate) fn handle_document_symbol(
253
253
let mut parents: Vec < ( DocumentSymbol , Option < usize > ) > = Vec :: new ( ) ;
254
254
255
255
for symbol in snap. analysis . file_structure ( file_id) ? {
256
+ let mut tags = Vec :: new ( ) ;
257
+ if symbol. deprecated {
258
+ tags. push ( SymbolTag :: Deprecated )
259
+ } ;
260
+
261
+ #[ allow( deprecated) ]
256
262
let doc_symbol = DocumentSymbol {
257
263
name : symbol. label ,
258
264
detail : symbol. detail ,
259
265
kind : to_proto:: symbol_kind ( symbol. kind ) ,
266
+ tags : Some ( tags) ,
260
267
deprecated : Some ( symbol. deprecated ) ,
261
268
range : to_proto:: range ( & line_index, symbol. node_range ) ,
262
269
selection_range : to_proto:: range ( & line_index, symbol. navigation_range ) ,
@@ -296,9 +303,19 @@ pub(crate) fn handle_document_symbol(
296
303
url : & Url ,
297
304
res : & mut Vec < SymbolInformation > ,
298
305
) {
306
+ let mut tags = Vec :: new ( ) ;
307
+
308
+ #[ allow( deprecated) ]
309
+ match symbol. deprecated {
310
+ Some ( true ) => tags. push ( SymbolTag :: Deprecated ) ,
311
+ _ => { }
312
+ }
313
+
314
+ #[ allow( deprecated) ]
299
315
res. push ( SymbolInformation {
300
316
name : symbol. name . clone ( ) ,
301
317
kind : symbol. kind ,
318
+ tags : Some ( tags) ,
302
319
deprecated : symbol. deprecated ,
303
320
location : Location :: new ( url. clone ( ) , symbol. range ) ,
304
321
container_name,
@@ -342,9 +359,12 @@ pub(crate) fn handle_workspace_symbol(
342
359
let mut res = Vec :: new ( ) ;
343
360
for nav in snap. analysis . symbol_search ( query) ? {
344
361
let container_name = nav. container_name . as_ref ( ) . map ( |v| v. to_string ( ) ) ;
362
+
363
+ #[ allow( deprecated) ]
345
364
let info = SymbolInformation {
346
365
name : nav. name . to_string ( ) ,
347
366
kind : to_proto:: symbol_kind ( nav. kind ) ,
367
+ tags : None ,
348
368
location : to_proto:: location_from_nav ( snap, nav) ?,
349
369
container_name,
350
370
deprecated : None ,
0 commit comments