redhat-developer / redhat-developer/yaml-language-server
Add quick fixes for obvious type errors
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.
One of the arguments some people use who don’t like YAML, is that types are hard to deal with in YAML. Some strings need to be quoted in YAML, whereas others do not. I think this might be useful to them.
Describe the solution you would like
Based on schema validation, add quick actions to convert:
trueorfalseto'true'or'false'if a string is expectednullto'null'if a string is expected- Numbers to numeric strings if a string is expected
- Dates and datetimes to strings if a string is expected
'true'or'false'totrueorfalseto if a boolean is expected'null'or'' (empty string)tonullif a null type is expected- Numeric strings to numbers if a number is expected
- Single line objects to a quoted string if a string is expected
- Multi line objects to a multiline string if a string is expected
- Any invalid value to a valid value if an enum is expected
Describe alternatives you have considered
Autofix would also be possible, but I think the user should be in control.
Additional context
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 schema-validation and quick-action entry points in the YAML language server. Review how user-controlled actions are represented, then cover the listed scalar, object, and enum conversions. Done means each requested conversion is available as an explicit quick action with validation coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, yaml
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100