mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Refine functional update completion some more
This commit is contained in:
parent
e1dcec0e02
commit
f6d6fda85b
3 changed files with 40 additions and 7 deletions
|
@ -63,6 +63,9 @@ pub(crate) enum ImmediateLocation {
|
|||
/// The record expr of the field name we are completing
|
||||
RecordExpr(ast::RecordExpr),
|
||||
// Original file ast node
|
||||
/// The record expr of the functional update syntax we are completing
|
||||
RecordExprUpdate(ast::RecordExpr),
|
||||
// Original file ast node
|
||||
/// The record pat of the field name we are completing
|
||||
RecordPat(ast::RecordPat),
|
||||
}
|
||||
|
@ -209,7 +212,7 @@ pub(crate) fn determine_location(
|
|||
},
|
||||
ast::RecordExprFieldList(_it) => sema
|
||||
.find_node_at_offset_with_macros(original_file, offset)
|
||||
.map(ImmediateLocation::RecordExpr)?,
|
||||
.map(ImmediateLocation::RecordExprUpdate)?,
|
||||
ast::TupleField(_it) => ImmediateLocation::TupleField,
|
||||
ast::TupleFieldList(_it) => ImmediateLocation::TupleField,
|
||||
ast::TypeBound(_it) => ImmediateLocation::TypeBound,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue