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

update formatter to handle record closing braces correctly. solves #7043 #8101

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

homberghp
Copy link

Solves #7043

Effectively moved one line, that corrects the record closing brace error.

The line

spaces(cs.spaceWithinMethodDeclParens() ? 1 : 0, true); // solves #7403 

has been removed in one spot and added in another.

Added tests to validate correct formatting.
Added record code to template text for the editor>formatting>java/spaces form.

I have no clue how the change in line 950 happened, but is white space only.
Editing in the source code done with netbeans 24 or ubuntu 24.04

homberghp and others added 2 commits December 30, 2024 11:12
…ition

adds tests to show the error
adds inner and outer record in ui template text for setting java format
spaces
solves the error by moving spaces(cs.spaceWithinMethodDeclParens() ? 1 : 0, true);  to the correct place.

solves apache#7043 formatter to handle record closing braces correctly

squashed commits of test and solution.
@homberghp homberghp changed the title update formatter to handle record closing braces correctly. solves #743 update formatter to handle record closing braces correctly. solves #7043 Dec 30, 2024
@mbien mbien added this to the NB25 milestone Dec 30, 2024
@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Dec 30, 2024
@mbien mbien linked an issue Dec 30, 2024 that may be closed by this pull request
@apache apache locked and limited conversation to collaborators Dec 30, 2024
@apache apache unlocked this conversation Dec 30, 2024
@mbien
Copy link
Member

mbien commented Jan 2, 2025

@homberghp I moved the new test back into FormattingTest and rebased to latest master
mbien@8cbbc9b

If you are ok with this I would like to squash it with your changes and create a new PR. Usually I would ask to push into the PR branch but you used master directly - I don't want to break your clone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reformat of record wrongly indents closing brace
2 participants