Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Move enum initializer to be before enumeration cases #102

Closed
sindresorhus opened this issue May 7, 2020 · 1 comment · Fixed by #103
Closed

Move enum initializer to be before enumeration cases #102

sindresorhus opened this issue May 7, 2020 · 1 comment · Fixed by #103
Labels
enhancement New feature or request

Comments

@sindresorhus
Copy link

In the HTML output.

I have an enum with a lot of cases and the user has to scroll all the way to the bottom to see the initializer, which I would argue is more important.

@mattt
Copy link
Contributor

mattt commented May 7, 2020

@sindresorhus Thanks for your feedback on this. This is a detail that I've gone back and forth on.

The challenge is that enumerations can be used in a few different ways, each prioritizing different information. For example, cases are more important for RawRepresentable enumerations, whereas initializers are more important at other times.

...actually, thinking about this again in relation to a solution proposed for #101:

Organize the symbol into a group with others for that protocol that are separate from type-specific declarations.

That would address the RawRepresentable case that motivated the current ordering. Given that, I agree — let's switch up the ordering. I can get a PR for that within the hour.

Edit: Ready for review: #103

@mattt mattt added the enhancement New feature or request label May 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants