redhat-developer / redhat-developer/vscode-java

Formatter Settings File Ignoring disabling_tag/enabling_tag

未关闭
#1,295 7 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

formatter
主要语言
TypeScript
星标
2.3k
派生
546
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,使用 issue 中显示的 workspace 设置和 formatter XML,在链接的示例项目的 autoformat-ignoring-disable-enable 分支上复现该行为。验证 formatter 集成,并确认在使用外部设置文件进行自动格式化时,// @formatter:off 和 // @formatter:on 之间的代码保持不变,即可完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, typescript, vscode
领域
tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。