mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
6877240fdf
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> |
||
---|---|---|
.. | ||
base_db | ||
cfg | ||
flycheck | ||
hir | ||
hir_def | ||
hir_expand | ||
hir_ty | ||
ide | ||
ide_assists | ||
ide_completion | ||
ide_db | ||
ide_diagnostics | ||
ide_ssr | ||
limit | ||
mbe | ||
parser | ||
paths | ||
proc_macro_api | ||
proc_macro_srv | ||
proc_macro_test | ||
profile | ||
project_model | ||
rust-analyzer | ||
sourcegen | ||
stdx | ||
syntax | ||
test_utils | ||
text_edit | ||
toolchain | ||
tt | ||
vfs | ||
vfs-notify |