1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-09-19 22:39:08 +00:00

[neovim] Replace yaml-companion with schemastore.nvim

This commit is contained in:
2025-09-19 19:23:18 +02:00
parent d090709d1c
commit 61a1cd6430
7 changed files with 42 additions and 30 deletions

View File

@@ -34,9 +34,8 @@ require("mason-lspconfig").setup({
automatic_installation = true,
})
local lspconfig = require("lspconfig")
for _, server in pairs(servers) do
if server ~= "yamlls" then
if server ~= "ty" then
local opts = {
capabilities = require("blink.cmp").get_lsp_capabilities(),
}
@@ -49,6 +48,6 @@ for _, server in pairs(servers) do
opts = vim.tbl_deep_extend("force", conf_opts, opts)
end
lspconfig[server].setup(opts)
vim.lsp.config(server, opts)
end
end

View File

@@ -0,0 +1,28 @@
return require("schema-companion").setup_client(
require("schema-companion").adapters.yamlls.setup({
sources = {
require("schema-companion").sources.matchers.kubernetes.setup({ version = "master" }),
require("schema-companion").sources.lsp.setup(),
require("schema-companion").sources.schemas.setup({
{
name = "Kubernetes master",
uri = "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master-standalone-strict/all.json",
},
}),
},
}),
{
-- Have to add this for yamlls to understand that we support line folding
capabilities = {
textDocument = {
foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
},
},
},
settings = {
redhat = { telemetry = { enabled = false } },
},
}
)