mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-04 09:18:46 +00:00
54c2ee9fab
Unify getter and setter assists This PR combines what previously have been two different files into a single file. I want to talk about the reasons why I did this. The issue that prompted this PR ( and before I forget : this pr fixes #15080 ) mentions an interesting behavior. We combine these two assists into an assist group and the order in which the assists are listed in this group changes depending on the text range of the selected area. The reason for that is that VSCode prioritizes actions that have a bigger impact in a smaller area and until now generate setter assist was only possible to be invoked for a single field whereas you could generate multiple getters for the getter assist. So I used the latter's infra to make former applicable to multiple fields, hence the unification. So this PR solves in essence 1. Make `generate setter` applicable to multiple fields 2. Provide a consistent order of the said assists in listing. |
||
---|---|---|
.. | ||
handlers | ||
tests | ||
utils | ||
assist_config.rs | ||
assist_context.rs | ||
lib.rs | ||
tests.rs | ||
utils.rs |