mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
feat: add multiple getters mode in generate_getter
This commit adds two modes to generate_getter action. First, the plain old working on single fields. Second, working on a selected range of fields.
This commit is contained in:
parent
97b357e41b
commit
5bff6c55de
8 changed files with 290 additions and 67 deletions
|
@ -198,7 +198,7 @@ fn get_adt_source(
|
|||
let file = ctx.sema.parse(range.file_id);
|
||||
let adt_source =
|
||||
ctx.sema.find_node_at_offset_with_macros(file.syntax(), range.range.start())?;
|
||||
find_struct_impl(ctx, &adt_source, fn_name).map(|impl_| (impl_, range.file_id))
|
||||
find_struct_impl(ctx, &adt_source, &[fn_name.to_string()]).map(|impl_| (impl_, range.file_id))
|
||||
}
|
||||
|
||||
struct FunctionTemplate {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue