Skip to content

New assist: add enum variant #11635

Closed
@matklad

Description

@matklad

image

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions