redhat-developer / redhat-developer/vscode-java

Empty formatter settings disable rules

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

还没有人认领这个 Issue。

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

描述

I have the google style eclipse settings activated in my user settings.
By accident, I've saved an empty string in my formatter settings of my workspace which lead to

"java.format.settings.url": ""

in my workspace settings.json. I did this in the UI so I didn't notice at first.
Apparently this overwrites the user settings.json file, formatting was done by the default formatting rules and not the ones specified in my user settings.json.

I'm not sure if this is intended or if it's actually related to how vscode (and not this plugin) handle settings values.

Environment
  • Operating System: macOS Catalina 10.15.1
  • JDK version: 1.8.0_202
  • Visual Studio Code version: 1.41.1
  • Java extension version: 0.55.1
Steps To Reproduce
  1. Set custom formatting rules in your user settings.json
"java.format.settings.url": "/PATH/TO/CUSTOM/RULES"
  1. Set custom formatting rules in a project's settings.json to empty string:
"java.format.settings.url": ""
Current Result

Empty-string 'java.format.settings.url' in workspace lead to usage of default rules of the plugin and not the settings url set in the user settings.json.

Expected Result

Empty-string should be a value that is ignored and therefore use the url defined in the user settings.json

Additional Informations

The only way to notice that there is an empty string in the workspace settings.json in the UI is the message that it is 'Modified in: Workspace' but the UI itself shows the same value as it would when it wasn't defined in the first place (empty string).

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先跟踪扩展在工作区值为空字符串时如何读取和应用 java.format.settings.url 配置。确认空的工作区值是否可以回退到用户值,并根据复现步骤验证其行为;issue 中未指定源文件或测试。

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

评估

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

把新 issue 发到你的邮箱

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