Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow # $schema: <url> to specify an inline schema #992

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Nerixyz
Copy link

@Nerixyz Nerixyz commented Oct 16, 2024

What does this PR do?

To aid interop with JetBrains' IntelliJ based IDEs, this adds support for specifying an inline-schema through # $schema: <url>. This is now the preferred way to specify an inline-schema. For backwards compatibility, the old way is still supported.

What issues does this PR fix or reference?

Fixes #959.

Is it tested? How?

Tested it with the yaml-vscode extension (and in unit tests).

  1. Below the comment, list the available completion items (in VS Code: CTRL+Space)
    # $schema: https://json.schemastore.org/clangd.json
  2. Same here, list the available completions below the comment
    # yaml-language-server: $schema=https://json.schemastore.org/clangd.json
    • In an empty file, list the available completions.
    • It should show Inline Schema. Use it.
    • It should complete to # $schema: with the cursor at the end.
    • List the available completions. It should show all available schemas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for specifying schema via # $schema: …
1 participant