redhat-developer / redhat-developer/vscode-java

Formatter Settings File Ignoring disabling_tag/enabling_tag

Open
#1,295 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

formatter
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
  1. Change workspace settings to:
{
    "java.format.settings.url": "https://raw.githubusercontent.com/snjeza/vscode-test/master/fluent.xml"
}
  1. Wrap some code w/ // @formatter:off & // @formatter:on
  2. Do something in that code that is outside of the default for the format settings
  3. Auto format the code (ALT + SHIFT + F)

Sample project

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:
image

After auto-format:
image

Format setting file:
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.