redhat-developer / redhat-developer/yaml-language-server
Option to drop quotes around keys in the formatter
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 352
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 11
Description
Is your enhancement related to a problem? Please describe.
I have some YAMLs where all keys are wrapped in quotation marks. That's unnecessary and makes reading YAML harder, because most syntax highlighters colour quoted keys same as string values.
Describe the solution you would like
Add a setting, e.g. yaml.format.unquoteKeys, that will drop all single and double quotes around keys when formatting.
Describe alternatives you have considered
I wrote an ugly script dropping quotes from keys, but I would like to have that integrated in my editor.
Additional context
I'm using VSCode.
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 locating the YAML formatter and the configuration handling for formatter settings, then trace how quoted mapping keys are emitted. Add the requested yaml.format.unquoteKeys behavior for single- and double-quoted keys, and verify that formatting removes those quotes without changing other YAML content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100