4b0f9c588d
Generate enum variant assist So, this is kind of a weird PR! I'm a complete newcomer to the `rust-analyzer` codebase, and so I browsed the "good first issue" tag, and found #11635. Then I found two separate folks had taken stabs at it, most recently `@maartenflippo` — and there had been a review 3 days ago, but no activity in a little while, and the PR needed to be rebased since the crates were renamed from `snake_case` to `kebab-case`. So to get acquainted with the codebase I typed this PR by hand, looking at the diff in #11995, and I also added a doc-test (that passes). I haven't taken into account the comments `@Veykril` left in #11995, but I don't want to steal any of `@maartenflippo's` thunder! Closing this PR is perfectly fine. Or Maarten could use it as a "restart point"? Or I could finish it up, whichever feels best to everyone. I think what remains to be done in this PR, at least, is: * [x] Only disable the "generate function" assist if the name is `PascalCase` * [x] Only enable the "generate variant" assistant if the name is `PascalCase` * [x] Simplify with `adt.source()` as mentioned here: https://github.com/rust-lang/rust-analyzer/pull/11995#discussion_r875134175 * [ ] Add more tests for edge cases? Are there cases where simply adding one more indent level than the enum's indent level is not good enough? Some nested trickery I'm not thinking of right now? Anyway. This PR can go in any direction. You can tell me "no, tackle your own issue!" And I'll go do that and still be happy I got to take a look at rust-analyzer some by doing this. Or you can tell me "okay, now _you_ finish it", and I guess I'll try and finish it :) Closes #11635 |
||
---|---|---|
.. | ||
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 |