File tree 3 files changed +12
-6
lines changed
ra_lsp_server/src/main_loop
3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ impl Analysis {
261
261
pub fn doc_comment_for (
262
262
& self ,
263
263
file_id : FileId ,
264
- symbol : FileSymbol
264
+ symbol : FileSymbol ,
265
265
) -> Cancelable < Option < String > > {
266
266
self . imp . doc_comment_for ( file_id, symbol)
267
267
}
Original file line number Diff line number Diff line change @@ -24,12 +24,17 @@ pub struct FileSymbol {
24
24
25
25
impl FileSymbol {
26
26
pub fn docs ( & self , file : & File ) -> Option < String > {
27
- file. syntax ( ) . descendants ( )
27
+ file. syntax ( )
28
+ . descendants ( )
28
29
. filter ( |node| node. kind ( ) == self . kind && node. range ( ) == self . node_range )
29
30
. filter_map ( |node : SyntaxNodeRef | {
30
31
fn doc_comments < ' a , N : DocCommentsOwner < ' a > > ( node : N ) -> Option < String > {
31
32
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
+ }
33
38
}
34
39
35
40
visitor ( )
@@ -42,7 +47,8 @@ impl FileSymbol {
42
47
. visit ( doc_comments :: < ast:: ConstDef > )
43
48
. visit ( doc_comments :: < ast:: StaticDef > )
44
49
. accept ( node) ?
45
- } ) . nth ( 0 )
50
+ } )
51
+ . nth ( 0 )
46
52
}
47
53
}
48
54
Original file line number Diff line number Diff line change @@ -494,8 +494,8 @@ pub fn handle_hover(
494
494
495
495
return Ok ( Some ( Hover {
496
496
contents,
497
- range : Some ( range)
498
- } ) )
497
+ range : Some ( range) ,
498
+ } ) ) ;
499
499
}
500
500
}
501
501
You can’t perform that action at this time.
0 commit comments