mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
fmt
This commit is contained in:
parent
3cd4112bdc
commit
ba71f05438
2 changed files with 5 additions and 6 deletions
|
@ -106,10 +106,9 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext
|
|||
|
||||
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,
|
||||
})?;
|
||||
|
|
|
@ -146,8 +146,8 @@ fn n_attached_trivias<'a>(
|
|||
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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue