redhat-developer / redhat-developer/vscode-yaml

Refresh the schema for a loaded document

Open
#202 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I have a situation where:

  • I need to fetch schemas from a remote location
  • Schemas can change when updates are deployed to the remote location

(Specifically, the environment is Kubernetes custom resource definitions, where the schemas in a cluster depend on what CRDs are deployed, and a CRD schema can change when the CRD is updated.)

My current approach is to have a fallback schema while I wait for the actual schemas to download, and to fetch new schemas when I detect changes that could affect the schema. This works fine for documents that are loaded after I have received the schemas.

But for documents that are already open at extension startup, vscode-yaml asks me for a schema when I only have the fallback one. And when I receive the real one I can't see a way to tell it "hey, I now have a better schema, can you use this one / ask me again please." Similarly, if someone opens a custom resource YAML document, then updates the schema for the custom resource definition, I can't tell vscode-yaml "hey, the schema for this document has changed, can you use this one instead, and recalculate validations and code completions etc."

Would it be possible to add a way to tell vscode-yaml to re-request the content of an existing schema, or to re-request the schema for an existing resource? Or would you recommend another way of tackling my scenario?

Please let me know if I can clarify this request in any way!

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

No files, tests, or entry points are named. Start by tracing how vscode-yaml requests schemas and applies them to already-open documents, then determine how schema refreshes should trigger validation and completion updates. Done means the extension can re-request or replace a schema for an existing document and recalculate its language features.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.