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

[json] publish schema of the VS Code-specific JSON Schema extensions #81078

Closed
pboushy opened this issue Sep 18, 2019 · 8 comments
Closed

[json] publish schema of the VS Code-specific JSON Schema extensions #81078

pboushy opened this issue Sep 18, 2019 · 8 comments
Assignees
Labels
feature-request Request for new features or functionality json JSON support issues *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@pboushy
Copy link

pboushy commented Sep 18, 2019

Microsoft has extended JSON Schema 7.0 as part of VSCode. It would be great for Microsoft to publish a "VSCode JSON Schema" so that we can easily find all the available elements for our JSON Schemas.

Example extension that Microsoft did:
defaultSnippets as mentioned at the bottom of https://code.visualstudio.com/Docs/languages/json

@pboushy
Copy link
Author

pboushy commented Sep 18, 2019

It looks like someone mentioned in a comment doing this, but the actual feature (“suggest specific schema”) was rejected. #67761
I’m now requesting what @octref mentioned in that comment.

@aeschli
Copy link
Contributor

aeschli commented Sep 18, 2019

These are really meant to be internal, for our settings editors.
Where would you want to use it?

@pboushy
Copy link
Author

pboushy commented Sep 18, 2019

@aeschli I'm creating a JSON Schema to use with VS Code. (https://github.com/prbsparx/JsonSchemas/blob/master/k8s.networkpolicies.calico.json) I have the YAML extension from Redhat installed, and noticed that when I put in a string that doesn't match my pattern (e.g. IP Address regex) VS code says "string does not match pattern of " which is not friendly to me or my coworkers who will be using it.
I want to be able to say "string is not a valid CIDR Network Address"
I believe that VS Code has the ability to provide a custom error (patternErrorMessage) but can't confirm what the schema terms are that VS Code uses.

@aeschli aeschli added this to the Backlog milestone Oct 10, 2019
@aeschli aeschli added feature-request Request for new features or functionality json JSON support issues labels Oct 10, 2019
@aeschli aeschli changed the title Publish schema of VS Code's JSON Schema [json] publish schema of the VS Code-specific JSON Schema extensions Oct 10, 2019
@vepanimas
Copy link

@aeschli, did I understand correctly that "defaultSnippets" is not even supported for the third-party extensions at the moment? Are there any workarounds to make it work, or do we need to wait for implementation in the VSCode itself?

@aeschli
Copy link
Contributor

aeschli commented Jan 13, 2020

'defaultSnippets' and 'patternErrorMessage;' and others in JSON schemas can be defined by anyone, but is something that the VScode JSON language server invented. It only make sense to use within VSCode. Any extension that defined new configuration settings or contributes a JSON can use it, there are no limitations.
Here's the full list: https://github.com/microsoft/vscode-json-languageservice/blob/8020161a681184ce13b349731a11cdae76020c9a/src/jsonSchema.ts#L58

@vepanimas
Copy link

vepanimas commented Jan 14, 2020

@aeschli ok, great. Thank you for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality json JSON support issues *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

5 participants
@pboushy @aeschli @vepanimas and others