mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
add is_blocklike func on BlockLike
This commit is contained in:
parent
98990affe5
commit
6e97527eae
3 changed files with 14 additions and 17 deletions
|
@ -198,6 +198,10 @@ impl BlockLike {
|
|||
fn is_block(self) -> bool {
|
||||
self == BlockLike::Block
|
||||
}
|
||||
|
||||
fn is_blocklike(kind: SyntaxKind) -> bool {
|
||||
matches!(kind, BLOCK_EXPR | IF_EXPR | WHILE_EXPR | FOR_EXPR | LOOP_EXPR | MATCH_EXPR)
|
||||
}
|
||||
}
|
||||
|
||||
const VISIBILITY_FIRST: TokenSet = TokenSet::new(&[T![pub], T![crate]]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue