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

Generically handle all method visibility modifiers #369

Merged
merged 3 commits into from
Dec 3, 2022

Conversation

reese
Copy link
Collaborator

@reese reese commented Nov 22, 2022

Resolves #363

Previously we explicitly listed out all "visibility modifiers" like private, private_class_method, etc. to avoid adding extra newlines to them when rendering "method modifiers" like sigs. However, there will probably always be some we could be missing this way (right now, this includes things like module_function and ruby2_keywords), so this PR changes it such that we generically this for anything of the shape

end
<whatever> def func

which seems more reasonable, especially if a user defined their own special method (like Sorbet's custom package_private).

@reese reese requested a review from fables-tales December 3, 2022 18:04
@reese reese merged commit cc74bbb into trunk Dec 3, 2022
@reese reese deleted the reese-method-modifier-spacing branch December 3, 2022 20:05
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.

Extra spacing between method decorators and definitions that use module_function
3 participants