From 5ee995ebead7f35e11aa1c27610d4ad4988a0949 Mon Sep 17 00:00:00 2001 From: Young Xu Date: Sun, 2 Apr 2023 17:45:18 +0800 Subject: [PATCH] feat: support yaml language server schema validate --- lua/lsp/protocol.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lua/lsp/protocol.lua b/lua/lsp/protocol.lua index 0ca66d4..1755ece 100644 --- a/lua/lsp/protocol.lua +++ b/lua/lsp/protocol.lua @@ -8,4 +8,18 @@ require("lspconfig").jsonls.setup({ require("lspconfig").taplo.setup({}) -require("lspconfig").yamlls.setup({}) +require("lspconfig").yamlls.setup({ + capabilities = capabilities, + settings = { + yaml = { + schemas = { + ["https://json.schemastore.org/golangci-lint.json"] = ".golangci.yaml", + ["https://json.schemastore.org/yamllint.json"] = ".protolint.yaml", + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", + }, + schemaStore = { enable = true }, + format = { enable = true }, + completion = true, + }, + }, +})