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

Use schema from "$schema": for current JSON file #964

Open
LnLcFlx opened this issue May 2, 2024 · 3 comments
Open

Use schema from "$schema": for current JSON file #964

LnLcFlx opened this issue May 2, 2024 · 3 comments

Comments

@LnLcFlx
Copy link

LnLcFlx commented May 2, 2024

I am using with nvim-lspconfig for editing a JSONC file like this.
When I add a modeline like # yaml-language-server: $schema=https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json I get the desired LSP functionalities.
But when I only use "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json" instead of the modeline, like suggested in the link above, it does not work.

What am I doing wrong?

@bollwyvl
Copy link
Contributor

Yes, also recently encountered this.

Having to suggest "only-works-in-this-tool" magic comments feels fairly antithetical to encouraging use of schema conventions.

For reference, other JSON-adjancent tools such as taplo support $schema.

@bollwyvl
Copy link
Contributor

Opened #970.

msivasubramaniaan added a commit to bollwyvl/yaml-language-server that referenced this issue May 28, 2024
bollwyvl added a commit to bollwyvl/yaml-language-server that referenced this issue May 30, 2024
bollwyvl added a commit to bollwyvl/yaml-language-server that referenced this issue Jun 11, 2024
@cromefire
Copy link

For reference, other JSON-adjancent tools such as taplo support $schema.

Also JetBrains' IDEs would be which are probably one of the other often used IDEs that are used with YAML files.

Only caveat though is that some tools GitLab CI don't like any extra key on their YAML and fail, but #959 would resolve that as well then.

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

No branches or pull requests

3 participants