From a62a5942deb281b9edce3673e656854805297199 Mon Sep 17 00:00:00 2001 From: Jonas Holst Damtoft Date: Sun, 30 Jul 2023 11:09:44 +0200 Subject: [PATCH] fix(yaml): yaml validate and enable line folding (#1251) * fix(yaml): enable validate see https://github.com/redhat-developer/yaml-language-server#language-server-settings * feat(yaml): support line folding --- lua/lazyvim/plugins/extras/lang/yaml.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/yaml.lua b/lua/lazyvim/plugins/extras/lang/yaml.lua index 52034664..ca808bbf 100644 --- a/lua/lazyvim/plugins/extras/lang/yaml.lua +++ b/lua/lazyvim/plugins/extras/lang/yaml.lua @@ -21,6 +21,15 @@ return { -- make sure mason installs the server servers = { yamlls = { + -- Have to add this for yamlls to understand that we support line folding + capabilities = { + textDocument = { + foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + }, + }, + }, -- lazy-load schemastore when needed on_new_config = function(new_config) new_config.settings.yaml.schemas = new_config.settings.yaml.schemas or {} @@ -33,7 +42,7 @@ return { format = { enable = true, }, - validate = { enable = true }, + validate = true, schemaStore = { -- Must disable built-in schemaStore support to use -- schemas from SchemaStore.nvim plugin