redhat-developer / redhat-developer/vscode-java
Formatter Settings File Ignoring disabling_tag/enabling_tag
未关闭
还没有人认领这个 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
- 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,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 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