From 6ad2cc78697f989e192db8fb4c417ab0f6b72a79 Mon Sep 17 00:00:00 2001 From: Ethan Holz Date: Wed, 5 Aug 2026 13:27:47 -0600 Subject: [PATCH] feat: migrate YAML language server to native config Add the complete native yaml-language-server definition and enable it at startup. Preserve the OMSF schema mapping while retaining formatting and disabled Red Hat telemetry. Assisted-by: Pi:openai-codex/gpt-5.6-sol --- init.lua | 1 + lsp/yamlls.lua | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/init.lua b/init.lua index 72bfec5..3386b6b 100644 --- a/init.lua +++ b/init.lua @@ -176,6 +176,7 @@ vim.lsp.enable({ "terraformls", "nil_ls", "ts_ls", + "yamlls", }) vim.api.nvim_create_autocmd("LspAttach", { callback = function(ev) diff --git a/lsp/yamlls.lua b/lsp/yamlls.lua index bc4d512..a54a53c 100644 --- a/lsp/yamlls.lua +++ b/lsp/yamlls.lua @@ -1,4 +1,20 @@ +---@brief +--- https://github.com/redhat-developer/yaml-language-server + +---@type vim.lsp.Config return { + cmd = function(dispatchers, config) + local cmd = "yaml-language-server" + if (config or {}).root_dir then + local local_cmd = vim.fs.joinpath(config.root_dir, "node_modules", ".bin", cmd) + if vim.fn.executable(local_cmd) == 1 then + cmd = local_cmd + end + end + return vim.lsp.rpc.start({ cmd, "--stdio" }, dispatchers) + end, + filetypes = { "yaml", "yaml.docker-compose", "yaml.gitlab", "yaml.helm-values" }, + root_markers = { ".git" }, settings = { redhat = { telemetry = { @@ -6,6 +22,9 @@ return { }, }, yaml = { + format = { + enable = true, + }, schemas = { ["https://directory.omsf.io/schema.json"] = { "/software/*", @@ -16,4 +35,7 @@ return { }, }, }, + on_init = function(client) + client.server_capabilities.documentFormattingProvider = true + end, } -- 2.51.2