Formatter Settings File Ignoring disabling_tag/enabling_tag
See original GitHub issueWhen 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:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
VS Code ignores Java formatter XML file - Stack Overflow
I suggest to use command Java: Open Java Formatter Settings to automatically generate a formatting profile for you.
Read more >Java formatting and linting - Visual Studio Code
After setting the formatter profile, the Format Document command will use the specific profile to format your Java files. Editing formatter settings. The ......
Read more >Ignoring Code - Prettier
Use “prettier-ignore” comments to ignore parts of files. Ignoring Files: .prettierignore. To exclude files from formatting, create a .prettierignore file in the ...
Read more >How to configure Prettier and VSCode - Gleb Bahmutov
Setup; Settings; VSCode setup; Format files from CLI; Format staged files on ... Print width; Ignoring files; Saving without formatting ...
Read more >Configure formatting rules | JetBrains Rider Documentation
Exclude files from reformatting · In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. · Switch to the Formatter...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could you find the setting
org.eclipse.jdt.core.formatter.use_on_off_tags
in the profile? This setting should be set totrue
to enable the disabling_tag and the enabling_tag.@spottedmahn could you try the following:
instead of