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] show which scheme is used to validate the current document #124139

Closed
SamB opened this issue May 18, 2021 · 2 comments
Closed

[json] show which scheme is used to validate the current document #124139

SamB opened this issue May 18, 2021 · 2 comments
Assignees
Labels
feature-request Request for new features or functionality json JSON support issues
Milestone

Comments

@SamB
Copy link
Contributor

SamB commented May 18, 2021

Issue Type: Feature Request

When I open/create a JSON file of a reasonably common type, with a somewhat recognizable name or structure, I tend to wonder if the JSON language features found a good schema for it or not, so I go to the command palette and search for commands with "JSON" in the name, and then commands with "schema" in the name.

I'm basically looking for the moral equivalent of nxml-mode's rng-what-schema command, which displays a message specifying the path to the schema file for the current document. It's very useful to see if you've got a good schema active.

VS Code version: VSCodium 1.56.2 (054a929, 2021-05-14T00:21:57.363Z)
OS version: Windows_NT x64 10.0.19043

Since this is about the bundled JSON language features, it shouldn't matter that this is an unofficial build using a different extension gallery.

@aeschli aeschli changed the title JSON: "what schema are we using?" command [json] show which scheme is used to validate the current document Oct 18, 2021
@aeschli aeschli added json JSON support issues feature-request Request for new features or functionality labels Oct 18, 2021
@aeschli aeschli added this to the Backlog milestone Oct 18, 2021
@Delapouite
Copy link

Hello @SamB

It looks like this feature is kind of already supported. For example, when I open a .gitlab-ci.yml file in one of my project, at the very top there's a small faded link which opens the associated JSON Schema when clicked:

image

Things to consider:

  • I have the GitLab extension installed so it may be because of that.
  • In this case it's a YAML file, so I'm unsure if it also applies to regular JSON files. (YAML is supposed to be a superset of JSON)
  • When I open other kinds of "well-known" files, like package.json in a Node.js project, it does not work.

@aeschli
Copy link
Contributor

aeschli commented Jun 10, 2022

I added this a while back. Hoover over { } in the language indicator and click on the Show schemas link.

@aeschli aeschli closed this as completed Jun 10, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality json JSON support issues
Projects
None yet
Development

No branches or pull requests

3 participants