Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: allow enum ordered const name override #1779

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

drewsilcock
Copy link

Describe the PR
Add ability to override name of enum variant generated from ordered constant using // @name VariantName in the same way you can do for types.

Relation issue
#1778

Additional context
N/A

const.go Outdated
func (cv *ConstVariable) VariableName() string {
if ignoreNameOverride(cv.Name.Name) {
return cv.Name.Name[1:]
} else if overriddenName := nameOverride(cv.Comment); overriddenName != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prease remove the useless else for better reading

types.go Outdated
return texts[1]
}
}
} else if overriddenName := nameOverride(t.TypeSpec.Comment); overriddenName != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@ubogdan
Copy link
Contributor

ubogdan commented Apr 21, 2024

@drewsilcock Please rebase and update the code.

@drewsilcock drewsilcock force-pushed the feature/allow-enum-ordered-const-name-override branch from 1443dbf to 61ef538 Compare April 29, 2024 10:54
@drewsilcock
Copy link
Author

Thanks for taking the time to take a look at this @ubogdan - I've rebased and updated based on the linter and your comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants