rust-analyzer/crates
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
..
base_db Fix standard library doclinks not going to the correct page 2021-10-20 16:36:01 +02:00
cfg a few clippy fixes 2021-10-14 19:57:21 +01:00
flycheck a few clippy fixes 2021-10-14 19:57:21 +01:00
hir Merge #10563 2021-10-20 21:02:46 +00:00
hir_def Merge #10387 2021-10-20 20:54:36 +00:00
hir_expand Merge #10387 2021-10-20 20:54:36 +00:00
hir_ty Merge #10563 2021-10-20 21:02:46 +00:00
ide Merge #10563 2021-10-20 21:02:46 +00:00
ide_assists Merge #10563 2021-10-20 21:02:46 +00:00
ide_completion Fix qualified lint completions ignoring the qualifier value 2021-10-20 14:03:41 +02:00
ide_db Merge #10563 2021-10-20 21:02:46 +00:00
ide_diagnostics Fix missing_fields diagnostic fix replacing wrong text ranges 2021-10-15 19:27:19 +02:00
ide_ssr internal: update expect 2021-10-09 17:17:16 +03:00
limit internal: add API to check what are the max limits in practice 2021-07-31 18:26:43 +03:00
mbe internal: clean up code duplication 2021-10-10 21:08:10 +03:00
parser internal: Parse const trait bounds 2021-10-19 14:20:00 +02:00
paths Fix miscellaneous Clippy lints 2021-10-03 23:53:30 +11:00
proc_macro_api Fix miscellaneous Clippy lints 2021-10-03 23:53:30 +11:00
proc_macro_srv internal: update expect 2021-10-09 17:17:16 +03:00
proc_macro_test cargo_metadata 0.14 2021-07-09 11:01:55 -04:00
profile Move IdxRange into la_arena 2021-10-15 13:03:28 +11:00
project_model Merge #10387 2021-10-20 20:54:36 +00:00
rust-analyzer Fix tests 2021-10-18 12:03:49 +03:00
sourcegen Add semicolons for consistency 2021-10-03 23:39:43 +11:00
stdx Kill the child process before waiting in streaming_output 2021-10-14 13:53:25 +02:00
syntax internal: Parse const trait bounds 2021-10-19 14:20:00 +02:00
test_utils Merge #10563 2021-10-20 21:02:46 +00:00
text_edit Fix miscellaneous Clippy lints 2021-10-03 23:53:30 +11:00
toolchain minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
tt Replace if let with match where appropriate 2021-10-05 09:00:21 +11:00
vfs Merge #10423 2021-10-12 18:35:03 +00:00
vfs-notify Fix miscellaneous Clippy lints 2021-10-03 23:53:30 +11:00