eclipse-jdt / eclipse-jdt/eclipse.jdt.core
Feature Request: "formatter:off" for variables with certain suffix or pattern
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
Hi,
in our code base we have many occurrences of HTML-Strings and that look like this for e.g.:
```java
String html =
//@formatter:off
"" +
"" +
"" + TimeUtils.formatMinutes(monthResult.effectiveWorkedTimeInMinutes) + "" +
"
" +
"" + actualWorkTimeOutput + "" +
"" +
"";
//@formatter:on
```
So we exclude that kind of variables from formatting by using formatter-on/off-tags. The intention to leave the variable-content unformatted is basically already defined by the variable name as it is "html".
So my feature request is roughly:
Add an option to the Java formatter, that excludes variable contents from being formatted for variable-names that match a certain regex.
Contributor guide
Assessment
This issue has not been assessed yet.