redhat-developer / redhat-developer/vscode-yaml
Support syntax highlight from different language for multi-line strings with a special comment
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
Is your enhancement related to a problem? Please describe.
I have a bunch of YAML files that embeds XML, JSON, Bash Scripts, Dockerfiles, and so on. When opening them in VS Code, such inline strings are interpreted as plain strings, which makes it a little difficult to edit.
Describe the solution you would like
To support syntax highlight of other languages for multi-line strings block that has a special comment. For example:
javascript: | # yaml-language-server: $language=javascript
console.log('hi')
json: | # yaml-language-server: $language=json
{
"hello": "world"
}
Describe alternatives you have considered
Extract the file to its own window, make the changes and then copy it back to the YAML file. Having syntax highlight directly in the YAML file would be a huge time saver :).
Additional context
It looks like this can be implemented in vscode through something like this: https://github.com/Microsoft/vscode-extension-samples/tree/main/decorator-sample
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 reviewing the VS Code decorator sample linked in the issue and how this extension handles YAML block scalars and special comments. The work is done when the requested language marker applies syntax highlighting to supported multiline strings in YAML files, including the JavaScript and JSON examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100