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 摘要。