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

Add support for specifying schema via # $schema: … #959

Open
pascal-hofmann opened this issue Apr 9, 2024 · 4 comments · May be fixed by #992
Open

Add support for specifying schema via # $schema: … #959

pascal-hofmann opened this issue Apr 9, 2024 · 4 comments · May be fixed by #992

Comments

@pascal-hofmann
Copy link

pascal-hofmann commented Apr 9, 2024

Is your enhancement related to a problem? Please describe.

JetBrains recently added support for specifying YAML schema via inline comment to their products. This looks similar to the modeline that can be used for yaml-language-server.

# $schema: …

Examples:

# $schema: https://example.com/path/to/schema.json
# $schema: ./schema.json

Describe the solution you would like

It would be great if yaml-language-server would support both ways (existing modeline, plus $schema: …) of specifying the schema inline, so we don't have to specify it twice.

Describe alternatives you have considered

None.

Additional context

@jeremyfiel
Copy link

jeremyfiel commented Jul 31, 2024

duplicate #950

@pascal-hofmann
Copy link
Author

pascal-hofmann commented Jul 31, 2024

duplicate #959

This is #959.

Did you mean #964?

@cromefire
Copy link

Currently it's not quite a duplicate of #950 as they made a crucial mustake that actually makes it incompatible with JetBrains' IDEs (= instead of :).

@tysonclugg
Copy link

tysonclugg commented Aug 20, 2024

duplicate #950

No, #950 is about getting the schema from inside the data strucutre, without using a modeline:

$schema: ./schema.json
foo: "1"

This issue is about adjusting the modeline parser to allow more relaxed forms of the schema declaration (ie: without the yaml-language-server guff) when using a modeline (aka: special comment):

# $schema: ./schema.json
foo: "1"

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 a pull request may close this issue.

4 participants