mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Add quickfix to add a struct field
This commit is contained in:
parent
b56ad148db
commit
f5ac313000
5 changed files with 134 additions and 5 deletions
|
@ -313,6 +313,16 @@ impl SourceAnalyzer {
|
|||
})?;
|
||||
Some(macro_call_id.as_file())
|
||||
}
|
||||
|
||||
pub(crate) fn resolve_variant(
|
||||
&self,
|
||||
db: &dyn HirDatabase,
|
||||
record_lit: ast::RecordLit,
|
||||
) -> Option<VariantId> {
|
||||
let infer = self.infer.as_ref()?;
|
||||
let expr_id = self.expr_id(db, &record_lit.into())?;
|
||||
infer.variant_resolution_for_expr(expr_id)
|
||||
}
|
||||
}
|
||||
|
||||
fn scope_for(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue