Open szechp opened 1 year ago
I'm just a Vim user. With Vim I use vim-lsp and vim-lsp-settings, which provide ways to configure the yaml-language-server settings. I don't know how you'd do those settings using Mason.
I had the same issue, but after setting the file pattern to enable the schema, it worked. For Kubernetes, you can do it like this: "*.yaml"
require("lspconfig").yamlls.setup {
on_attach = on_attach,
capabilities = capabilities,
settings = {
yaml = {
schemas = {
kubernetes = "*.yaml",
},
},
},
}
I'm facing the same issue, in my case with the overridden schema via
client.config.settings = vim.tbl_deep_extend("force", client.config.settings, {
yaml = {
schemas = {
[schema] = uri,
},
},
})
client.notify("workspace/didChangeConfiguration")
I'm facing the same issue, in my case with the overridden schema via
client.config.settings = vim.tbl_deep_extend("force", client.config.settings, { yaml = { schemas = { [schema] = uri, }, }, }) client.notify("workspace/didChangeConfiguration")
The only thing that is working, are the # yaml-language-server: $schema=
overrides, but the config.settings.yaml.schemas.$schema=$file
aren't working
Lua code for reproduction;
local client = require("lspconfig.util").get_active_client_by_name(vim.api.nvim_get_current_buf(), "yamlls")
client.config.settings = vim.tbl_deep_extend("force", client.config.settings, {
yaml = {
schemas = {
[https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master-standalone-strict/deployment-apps-v1.json] = vim.uri_from_bufnr(vim.api.nvim_get_current_buf()),
},
},
})
client.notify("workspace/didChangeConfiguration", { settings = client.config.settings })
In other words,
{
redhat = {
telemetry = {
enabled = false
}
},
yaml = {
schemas = {
["file:///tmp/lua_5MZoE1"] = "file:///home/cwr/work/clusters/1111-test-cwr-ffm3-2207/cluster.yaml"
}
}
}
is not working
Hello,
I've been facing an issue when trying to use the YAML Language Server (yamlls) with Neovim's built-in LSP client on MacOS 13. While the language server appears to attach correctly to the buffer and my configuration seems to be set up correctly, I'm not getting any syntax highlighting, autocomplete, or suggestions. Additionally, the YAML Language Server is not working in Visual Studio Code either, even when using the official YAML extension.
Here are the relevant details:
v0.9.1
v20.2.0
1.78
/Users/<username>/.local/share/nvim/mason/bin/yaml-language-server --stdio
:LspInfo
in Neovim.which node
returns the expected path to the Node.js binary (/opt/homebrew/bin/node
), so Node.js is installed correctly and available in the PATH./Users/philipp/.local/state/nvim/lsp.log
).Despite these steps, I'm still not seeing syntax highlighting, autocomplete, or suggestions in YAML files in both Neovim and VSCode. Any guidance on how to debug or fix this issue would be greatly appreciated.
Thank you