redhat-developer / redhat-developer/vscode-yaml

Pick up schema from $schema prop like with JSON

Open
#567 5 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
829
Forks
260
Avg merge
5h 43m
Merged PRs (30d)
1

Description

In case of JSON files it's possible to discover the support for $schema naturally by following the Trigger Suggest command:

https://user-images.githubusercontent.com/1932383/126984982-a9660d62-b473-469c-833d-9665adcf9ff2.mov

Tho with YAML, even if you were to write out the comment you would see no autocompletion. To achieve same you should write out # yaml-language-server: $schema=https://json.schemastore.org/tsconfig. Which should be memoized, or stored as a snippet. or you should mess with configuration of this extension, which should be discovered in the first place and is not as portable as $schema is with json.

https://user-images.githubusercontent.com/1932383/126985088-6160c7ba-70bf-4ad9-9410-134386a13ff9.mov

Describe the solution you would like

It would be great to support similar UX to what exists with JSON. where suggestions help you discover $schema support and then by specifying $schema, schema is used to validate the file. no need to mess with extentsion configuration or comments.

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 tracing the existing JSON "Trigger Suggest" behavior and the YAML language-server handling of $schema and yaml-language-server comments. Define how a YAML $schema property should trigger schema discovery and validation, then verify the behavior with the extension's existing test coverage; the issue names no specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.