apache / apache/netbeans

Additional formatting options for Java in the category 'Blank lines'

Open
#6,083 0 comments 0 reactions 0 assignees View on GitHub
kind:feature needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

Extend the existing Java formatting options in the category 'Blank lines' by the following options:

* After Method Header
* After (Inner) Class Header
* After (Inner) Interface Header
* After Constructor Header
* After if, for, try, catch, finally, while Header

* Before Method Closing Brace
* Before Inner Class Closing Brace
* Before (Inner) Interface Closing Brace
* Before Constructor Closing Brace
* Before if, for, try, catch, finally, while Closing Brace

Maybe these options could be summarized under a collapseable menu containing the different kinds of headers and closing braces. The menus could just called "After Header" and "Before closing brace". But that's obviously not that important in the beginning.

![Java-Formatting-Options](https://github.com/apache/netbeans/assets/55635116/83db6010-2b68-4baf-8217-46d09c49be91)

### Use case/motivation

At work, we have formatting guidelines that differ from common guidelines.
To achieve the desired formatting it would be helpful to extend the existing formatting options for Java by the aforementioned options. Due to the fact that similar options already exist (red square area). Additionally it would complete the existing formatting options. In general this might benefit people who would like a much spacier look of the code. I hope that this could be implemented easily.

### Related issues

_No response_

### Are you willing to submit a pull request?

Yes

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing Java formatting options in the “Blank lines” category and compare them with the requested header and closing-brace cases. Add the listed options, optionally grouped under the suggested menus, and verify that each setting produces the requested blank lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.