redhat-developer / redhat-developer/vscode-java
Formatter Settings File Ignoring disabling_tag/enabling_tag
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
When I specify a formatter settings file, the disable/enable formatting tags are ignored.
Environment
- Operating System: Win10 v1909 WSL 1 Ubuntu 18.04
- JDK version: openjdk version "11.0.5" 2019-10-15
- Visual Studio Code version: 1.42.1 (user setup)
- Java extension version: 0.55.1
Steps To Reproduce
- Change workspace settings to:
{
"java.format.settings.url": "https://raw.githubusercontent.com/snjeza/vscode-test/master/fluent.xml"
}
- Wrap some code w/
// @formatter:off&// @formatter:on - Do something in that code that is outside of the default for the format settings
- Auto format the code (ALT + SHIFT + F)
Current Result
Code between // @formatter:off & // @formatter:on is formatted
Expected Result
Code between // @formatter:off & // @formatter:on shouldn't be formatted
Additional Informations
Before auto-format:

After auto-format:

Format setting file:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior in the linked sample project on the autoformat-ignoring-disable-enable branch, using the workspace setting and formatter XML shown in the issue. Verify the formatter integration and confirm completion when code between // @formatter:off and // @formatter:on remains unchanged during auto-formatting with the external settings file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100