-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New assist: add enum variant #11635
Copy link
Copy link
Closed
Labels
A-assistsC-featureCategory: feature requestCategory: feature requestE-has-instructionsIssue has some instructions and pointers to code to get startedIssue has some instructions and pointers to code to get startedE-mediumgood first issue
Metadata
Metadata
Assignees
Labels
A-assistsC-featureCategory: feature requestCategory: feature requestE-has-instructionsIssue has some instructions and pointers to code to get startedIssue has some instructions and pointers to code to get startedE-mediumgood first issue
Type
Fields
Give feedbackNo fields configured for issues without a type.
It'd be cool if in this situation rust-analyzer realized that that what we want here is not a function, but a new error variant.
Looking at how generate function works should help with implementing this assist:
https://github.com/rust-analyzer/rust-analyzer/blob/5b9e46b960c37f04a26742c186e0a26b7bc131b3/crates/ide_assists/src/handlers/generate_function.rs
Note that generate function grew quite complex over time, for learning purposes, you might want to check some of its earlier versions