Do not drop ..Default::default() completion when typing ..

This commit is contained in:
Lukas Wirth 2021-08-10 14:58:14 +02:00
parent f2246fecef
commit e729529410
3 changed files with 84 additions and 49 deletions

View file

@ -191,6 +191,7 @@ pub(crate) fn determine_location(
}
}
};
let res = match_ast! {
match parent {
ast::IdentPat(_it) => ImmediateLocation::IdentPat,
@ -206,6 +207,9 @@ pub(crate) fn determine_location(
} else {
ImmediateLocation::RecordField
},
ast::RecordExprFieldList(_it) => sema
.find_node_at_offset_with_macros(original_file, offset)
.map(ImmediateLocation::RecordExpr)?,
ast::TupleField(_it) => ImmediateLocation::TupleField,
ast::TupleFieldList(_it) => ImmediateLocation::TupleField,
ast::TypeBound(_it) => ImmediateLocation::TypeBound,