Skip to content

Commit

Permalink
Fix settings update before workspace/didChangeConfiguration notific…
Browse files Browse the repository at this point in the history
…ation (#50)
  • Loading branch information
agorgl committed Jul 14, 2024
1 parent d190d6c commit 131b0d6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/yaml-companion/context/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 131b0d6

Please sign in to comment.