From fda80051a348eb94c3ac7c6950e14b184d96b99a Mon Sep 17 00:00:00 2001 From: Loukas Agorgianitis Date: Thu, 30 May 2024 15:17:28 +0300 Subject: [PATCH] Fix settings update before `workspace/didChangeConfiguration` notification --- lua/yaml-companion/context/init.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lua/yaml-companion/context/init.lua b/lua/yaml-companion/context/init.lua index ab289ce..6fc9b0e 100644 --- a/lua/yaml-companion/context/init.lua +++ b/lua/yaml-companion/context/init.lua @@ -150,7 +150,7 @@ M.schema = function(bufnr, new_schema) local bufuri = vim.uri_from_bufnr(bufnr) local client = M.ctxs[bufnr].client - local settings = client.config.settings + local settings = client.settings -- we don't want more than 1 schema per file for key, _ in pairs(settings.yaml.schemas) do @@ -165,9 +165,8 @@ M.schema = function(bufnr, new_schema) log.fmt_debug("file=%s schema=%s set new override", bufuri, new_schema.uri) settings = vim.tbl_deep_extend("force", settings, { yaml = { schemas = override } }) - client.config.settings = - vim.tbl_deep_extend("force", settings, { yaml = { schemas = override } }) - client.workspace_did_change_configuration(client.config.settings) + client.settings = vim.tbl_deep_extend("force", settings, { yaml = { schemas = override } }) + client.workspace_did_change_configuration(client.settings) end return M.ctxs[bufnr].schema