File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
ra_lsp_server/src/main_loop Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ impl Analysis {
261261 pub fn doc_comment_for (
262262 & self ,
263263 file_id : FileId ,
264- symbol : FileSymbol
264+ symbol : FileSymbol ,
265265 ) -> Cancelable < Option < String > > {
266266 self . imp . doc_comment_for ( file_id, symbol)
267267 }
Original file line number Diff line number Diff line change @@ -24,12 +24,17 @@ pub struct FileSymbol {
2424
2525impl FileSymbol {
2626 pub fn docs ( & self , file : & File ) -> Option < String > {
27- file. syntax ( ) . descendants ( )
27+ file. syntax ( )
28+ . descendants ( )
2829 . filter ( |node| node. kind ( ) == self . kind && node. range ( ) == self . node_range )
2930 . filter_map ( |node : SyntaxNodeRef | {
3031 fn doc_comments < ' a , N : DocCommentsOwner < ' a > > ( node : N ) -> Option < String > {
3132 let comments = node. doc_comment_text ( ) ;
32- if comments. is_empty ( ) { None } else { Some ( comments) }
33+ if comments. is_empty ( ) {
34+ None
35+ } else {
36+ Some ( comments)
37+ }
3338 }
3439
3540 visitor ( )
@@ -42,7 +47,8 @@ impl FileSymbol {
4247 . visit ( doc_comments :: < ast:: ConstDef > )
4348 . visit ( doc_comments :: < ast:: StaticDef > )
4449 . accept ( node) ?
45- } ) . nth ( 0 )
50+ } )
51+ . nth ( 0 )
4652 }
4753}
4854
Original file line number Diff line number Diff line change @@ -494,8 +494,8 @@ pub fn handle_hover(
494494
495495 return Ok ( Some ( Hover {
496496 contents,
497- range : Some ( range)
498- } ) )
497+ range : Some ( range) ,
498+ } ) ) ;
499499 }
500500 }
501501
You can’t perform that action at this time.
0 commit comments