redhat-developer / redhat-developer/vscode-java
Empty formatter settings disable rules
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
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
- Set custom formatting rules in your user settings.json
"java.format.settings.url": "/PATH/TO/CUSTOM/RULES"
- 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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the extension reads and applies the java.format.settings.url configuration when the workspace value is an empty string. Confirm whether an empty workspace value can fall back to the user value, and verify the behavior against the reproduction steps; no source file or test is identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100