fn completion_match(ctx: &CompletionContext) -> Option<(SyntaxNode, ImplDef)> {
let (trigger, impl_def_offset) = ctx.token.ancestors().find_map(|p| match p.kind() {
- SyntaxKind::FN
- | SyntaxKind::TYPE_ALIAS
- | SyntaxKind::CONST
- | SyntaxKind::BLOCK_EXPR => Some((p, 2)),
+ SyntaxKind::FN | SyntaxKind::TYPE_ALIAS | SyntaxKind::CONST | SyntaxKind::BLOCK_EXPR => {
+ Some((p, 2))
+ }
SyntaxKind::NAME_REF => Some((p, 5)),
_ => None,
})?;
trivias: impl Iterator<Item = (SyntaxKind, &'a str)>,
) -> usize {
match kind {
- MACRO_CALL | CONST | TYPE_ALIAS | STRUCT | ENUM | VARIANT | FN | TRAIT_DEF
- | MODULE | RECORD_FIELD | STATIC => {
+ MACRO_CALL | CONST | TYPE_ALIAS | STRUCT | ENUM | VARIANT | FN | TRAIT_DEF | MODULE
+ | RECORD_FIELD | STATIC => {
let mut res = 0;
let mut trivias = trivias.enumerate().peekable();