-
Hello, I've been experimenting with Zed on some of my work projects, and noticed that the ability to select a Yaml schema is not exposed in the bottom toolbar when I saw in the Zed documentation that we can customize the lsp settings for a given lsp. For yaml I saw that we have a few options for getting, and setting json schemas for a given project. The most useful option would be to set a glob pattern using a local zed Following this I created a helm chart with {
"lsp": {
"yaml-language-server": {
"initialization_options": {
"yaml": {
"schemas": {
"http://json.schemastore.org/chart.json": "templates/*.yaml"
}
}
}
}
}
} This does not enable me set the yaml schema in the template example such as with I have also tried {
"lsp": {
"yaml-language-server": {
"initialization_options": {
"yaml.schemas": {
"http://json.schemastore.org/chart.json": "templates/*.yaml"
}
}
}
}
} With no luck. I can tell this is using I have also tried this in the global Is there another way to set yaml schemas, per-project, using relative file glob patterns? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 12 replies
-
I'm experiencing the same issue. I noticed in the RPC message logs that only the inline schema is being searched. When it's configured in |
Beta Was this translation helpful? Give feedback.
-
I haven't messed with it too much, but we should support specifying the schema either via the inline modeline (which sounds like it's working for you) or via the LSP settings (which sounds like it is not working). I would expect if you have both that the inline would override the one provided by settings. Looking the yaml-language-server docs, nearly all of their examples include a leading slash on the glob pattern. Could you try and see if instead of specifying |
Beta Was this translation helpful? Give feedback.
-
something I noticed what was mentioned above and was seeing UI feedback only after adding the inline schema mentioned in zed's docs until I switched from using the However I noticed additional unexpected behavior that might be related to zeds deserialization of settings before passing it off the the lsp. In my configuration I have "lsp": {
"yaml-language-server": {
"initialization_options": {
"yaml": {
"schemas": {
"feature-flags/schema.json": ["feature-flags/definitions/**/*.yml"]
}
}
}
}
} Expected behavior: This should read the schema from from Actual behavior: The file match does work but zed's ui highlights an error in any opened matching doc saying What did work was |
Beta Was this translation helpful? Give feedback.
-
We should definitely try amd support project-relative pathing for schema json. Also curious whether vscode with yaml-language-server works with the relative paths you've tried. If they don't work there, then it's an upstream yaml-language-server issue. If it works in vscode but not zed please file an issue (ideally with a minimal reproduction repo showing it working in vscode but broken in Zed). |
Beta Was this translation helpful? Give feedback.
-
That's super wonky. Looking at the As for the comma, do you happen to live in a country which has commas for decimal separator? (Germany, etc) I wonder whether that call to Anyways, if anyone could provide me with a self-contained reproduction repo to start with I might be able to find some time to track this down. |
Beta Was this translation helpful? Give feedback.
A few things.
settings
.Chart.yaml
works (for me) no settings required.kind
. This is the wrong schema andyaml-language-server
is telling you that.yaml-language-server
Are you seeing something different?
This isn't a Zed settings, yaml-language-server configuration or JSON schema issue at all.
You can't validate the JSON schema of a template.
It's like complaining that a PHP script doesn't validate as html: