rust-analyzer/crates/ide_db/src/helpers
bors[bot] 6877240fdf
Merge #10563
10563: feat: Make "Generate getter" assist use semantic info r=agluszak a=agluszak

This PR makes "Generate getter" assist use semantic info instead of dealing with types encoded as strings.
Getters for types which are:
- `Copy` no longer return references
- `AsRef<str>` (i.e. `String`) return `&str` (instead of `&String`)
- `AsRef<[T]>` (i.e. `Vec<T>`) return `&[T]` (instead of `&Vec<T>`)
- `AsRef<T>` (i.e. `Box<T>`) return `&T` (instead of `&Box<T>`)
- `Option<T>` return `Option<&T>` (instead of `&Option<T>`)
- `Result<T, E>` return `Result<&T, &E>` (instead of `&Result<T, E>`)

String, Vec, Box and Option were previously handled as special cases.

Closes #10295


Co-authored-by: Andrzej Głuszak <gluszak.andrzej@gmail.com>
2021-10-20 21:02:46 +00:00
..
insert_use fix: fix insert_use incorrectly merging glob imports 2021-10-03 14:06:44 +02:00
famous_defs.rs Semantic getter 2021-10-17 16:33:14 +02:00
generated_lints.rs Generate rustdoc lints 2021-10-20 13:48:05 +02:00
import_assets.rs Rename *Owner traits to Has* 2021-09-27 12:54:24 +02:00
insert_use.rs Move module private logic down 2021-10-03 13:52:40 +02:00
merge_imports.rs fix: fix insert_use incorrectly merging glob imports 2021-10-03 14:06:44 +02:00
node_ext.rs Fix inline_call breaking RecordExprField shorthands 2021-09-28 19:22:32 +02:00
rust_doc.rs Check for rust doc code attributes like rustdoc does 2021-04-19 13:32:52 +02:00