mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Better visibility check.
This commit is contained in:
parent
27c071f702
commit
b9ca8ab868
1 changed files with 5 additions and 1 deletions
|
@ -83,7 +83,11 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn has_visibility(node: &SyntaxNode) -> bool {
|
fn has_visibility(node: &SyntaxNode) -> bool {
|
||||||
return node.descendants().any(|n| n.kind() == VISIBILITY);
|
use ast::VisibilityOwner;
|
||||||
|
|
||||||
|
return ast::Module::cast(node)
|
||||||
|
.and_then(|m| m.visibility())
|
||||||
|
.is_some();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn has_newline(node: &SyntaxNode) -> bool {
|
fn has_newline(node: &SyntaxNode) -> bool {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue