mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 01:17:27 +00:00
Rustfmt to pass CI
This commit is contained in:
parent
a83ed374d0
commit
c29f158c20
3 changed files with 12 additions and 6 deletions
|
@ -261,7 +261,7 @@ impl Analysis {
|
|||
pub fn doc_comment_for(
|
||||
&self,
|
||||
file_id: FileId,
|
||||
symbol: FileSymbol
|
||||
symbol: FileSymbol,
|
||||
) -> Cancelable<Option<String>> {
|
||||
self.imp.doc_comment_for(file_id, symbol)
|
||||
}
|
||||
|
|
|
@ -24,12 +24,17 @@ pub struct FileSymbol {
|
|||
|
||||
impl FileSymbol {
|
||||
pub fn docs(&self, file: &File) -> Option<String> {
|
||||
file.syntax().descendants()
|
||||
file.syntax()
|
||||
.descendants()
|
||||
.filter(|node| node.kind() == self.kind && node.range() == self.node_range)
|
||||
.filter_map(|node: SyntaxNodeRef| {
|
||||
fn doc_comments<'a, N: DocCommentsOwner<'a>>(node: N) -> Option<String> {
|
||||
let comments = node.doc_comment_text();
|
||||
if comments.is_empty() { None } else { Some(comments) }
|
||||
if comments.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(comments)
|
||||
}
|
||||
}
|
||||
|
||||
visitor()
|
||||
|
@ -42,7 +47,8 @@ impl FileSymbol {
|
|||
.visit(doc_comments::<ast::ConstDef>)
|
||||
.visit(doc_comments::<ast::StaticDef>)
|
||||
.accept(node)?
|
||||
}).nth(0)
|
||||
})
|
||||
.nth(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -494,8 +494,8 @@ pub fn handle_hover(
|
|||
|
||||
return Ok(Some(Hover {
|
||||
contents,
|
||||
range: Some(range)
|
||||
}))
|
||||
range: Some(range),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue