redhat-developer / redhat-developer/yaml-language-server

Option to drop quotes around keys in the formatter

Open
#542 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

formatter
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.