redhat-developer / redhat-developer/vscode-yaml

Is it possible to define schema for custom tags?

Open
#680 7 comments 7 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

Summary

Hi team, I have a custom tag !include with 2 properties source and path.

Usage case:

object:
  <<: !include
    source: './abc/xyz'
    path: anyField

For now I have added it into yaml.customTags in settings: "yaml.customTags": ["!include mapping"].

No errors. Great!

But I hope to add additional checks on it, such as tagging source and path as required. Is it possible? And how should I to implement it? Thanks.

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 yaml.customTags setting and its mapping form for the !include tag. Determine how custom-tag validation is currently handled and define how missing source or path should be reported. Done means the custom tag can declare both properties as required and invalid usage produces clear diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode, yaml
Domain
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.