You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If possible I would like to inline schema like this: # $schema=...
Would be more consistent with the way you do it in JSON and would be more compatible with Intellij and maybe other IDEs
Describe alternatives you have considered
Additional context
I use yaml with JSON Schema a lot in VS Code. Many of my colleagues use Intellij for YAML editing.
Both IDE's have a slightly different way to inline the JSON Schema.
You made a huge (and at the same time small) mistake there, # $schema= ... doesn't work at all in JetBrains' IDEs.
Instead JetBains' IDEs support both a JSON schema standard equivalent $schema: ... and the commented out version # $schema: ... (because : in YAML makes more sense as $schema= wouldn't be valid YAML and so the commended out form mimics the form in YAML directly)
I do agree that it's a huge pain though, most of us use JetBrains, but we have that one colleague that uses VSCode, so be always have to have
# $schema: ...# yaml-language-server: $schema=...
on top of our language files.
I think it'd also probably make sense to make $schema: ... the new default then as it has virtually no downsides and better compatibility.
Is your enhancement related to a problem? Please describe.
Not really. Feature works as expected, I just always need to look up the right way to use inline schema (https://github.com/redhat-developer/yaml-language-server?tab=readme-ov-file#using-inlined-schema)
Describe the solution you would like
If possible I would like to inline schema like this:
# $schema=...
Would be more consistent with the way you do it in JSON and would be more compatible with Intellij and maybe other IDEs
Describe alternatives you have considered
Additional context
I use yaml with JSON Schema a lot in VS Code. Many of my colleagues use Intellij for YAML editing.
Both IDE's have a slightly different way to inline the JSON Schema.
# yaml-language-server: $schema=....
# $schema=....
Probably the place that needs changing/extending
In doComplete of yamlCompletion.ts
For commitId [dfccc6f] it was around the line 319
if (isModeline(lineContent) || isInComment(doc.tokens, offset)) {
IsModeline is pretty straight forward. Couldn't figure out how isInComment was expected to behave here
Additionally the docs need a small update for this change and maybe the unit tests
The full relevant code fragment
The text was updated successfully, but these errors were encountered: