From dead004866fdcd26735b4789a33f54b2f44728d8 Mon Sep 17 00:00:00 2001 From: Dave Greene Date: Wed, 1 May 2024 15:34:32 -0400 Subject: [PATCH 1/3] Update deprecated health API calls. (#42) --- lua/yaml-companion/_matchers/init.lua | 2 +- lua/yaml-companion/health.lua | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lua/yaml-companion/_matchers/init.lua b/lua/yaml-companion/_matchers/init.lua index 5f3df76..4d50935 100644 --- a/lua/yaml-companion/_matchers/init.lua +++ b/lua/yaml-companion/_matchers/init.lua @@ -22,7 +22,7 @@ matchers.manager = setmetatable({}, { t[k] = { health = m.health or function() local health = vim.health - health.report_info("No healthcheck provided") + health.info("No healthcheck provided") end, match = m.match or function(_) return nil diff --git a/lua/yaml-companion/health.lua b/lua/yaml-companion/health.lua index c569998..82ff9bb 100644 --- a/lua/yaml-companion/health.lua +++ b/lua/yaml-companion/health.lua @@ -26,32 +26,32 @@ M.check = function() if not binary_installed(binary.bin) then local bin_not_installed = binary.bin .. " not found" if binary.optional then - health.report_warn(("%s %s"):format(bin_not_installed, binary.info)) + health.warn(("%s %s"):format(bin_not_installed, binary.info)) else - health.report_error(binary.bin .. " not found") + health.error(binary.bin .. " not found") end else - health.report_ok(binary.bin .. " found") + health.ok(binary.bin .. " found") end end - health.report_start("Checking for plugins") + health.start("Checking for plugins") for _, plugin in ipairs(plugins) do if lualib_installed(plugin.lib) then - health.report_ok(plugin.lib .. " installed") + health.ok(plugin.lib .. " installed") else local lib_not_installed = plugin.lib .. " not found" if plugin.optional then - health.report_warn(("%s %s"):format(lib_not_installed, plugin.info)) + health.warn(("%s %s"):format(lib_not_installed, plugin.info)) else - health.report_error(lib_not_installed) + health.error(lib_not_installed) end end end local matchers = require("yaml-companion._matchers")._loaded for name, matcher in pairs(matchers) do - health.report_start(string.format("Matcher: `%s`", name)) + health.start(string.format("Matcher: `%s`", name)) matcher.health() end end From d190d6c0852a1b3fd2798cf1529655f7f68655d3 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Wed, 1 May 2024 21:35:35 +0200 Subject: [PATCH 2/3] [create-pull-request] automated change (#36) Co-authored-by: someone-stole-my-name --- .../builtin/kubernetes/resources.lua | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lua/yaml-companion/builtin/kubernetes/resources.lua b/lua/yaml-companion/builtin/kubernetes/resources.lua index 5718131..8eb38f4 100644 --- a/lua/yaml-companion/builtin/kubernetes/resources.lua +++ b/lua/yaml-companion/builtin/kubernetes/resources.lua @@ -22,6 +22,8 @@ return { "ClusterRoleBinding", "ClusterRoleBindingList", "ClusterRoleList", + "ClusterTrustBundle", + "ClusterTrustBundleList", "ComponentStatus", "ComponentStatusList", "ConfigMap", @@ -48,6 +50,8 @@ return { "FlowSchemaList", "HorizontalPodAutoscaler", "HorizontalPodAutoscalerList", + "IPAddress", + "IPAddressList", "Ingress", "IngressClass", "IngressClassList", @@ -75,8 +79,8 @@ return { "PodDisruptionBudget", "PodDisruptionBudgetList", "PodList", - "PodScheduling", - "PodSchedulingList", + "PodSchedulingContext", + "PodSchedulingContextList", "PodTemplate", "PodTemplateList", "PriorityClass", @@ -89,12 +93,18 @@ return { "ReplicationControllerList", "ResourceClaim", "ResourceClaimList", + "ResourceClaimParameters", + "ResourceClaimParametersList", "ResourceClaimTemplate", "ResourceClaimTemplateList", "ResourceClass", "ResourceClassList", + "ResourceClassParameters", + "ResourceClassParametersList", "ResourceQuota", "ResourceQuotaList", + "ResourceSlice", + "ResourceSliceList", "Role", "RoleBinding", "RoleBindingList", @@ -110,6 +120,8 @@ return { "Service", "ServiceAccount", "ServiceAccountList", + "ServiceCIDR", + "ServiceCIDRList", "ServiceList", "StatefulSet", "StatefulSetList", @@ -118,6 +130,8 @@ return { "StorageClassList", "StorageVersion", "StorageVersionList", + "StorageVersionMigration", + "StorageVersionMigrationList", "SubjectAccessReview", "TokenRequest", "TokenReview", @@ -129,5 +143,7 @@ return { "ValidatingWebhookConfigurationList", "VolumeAttachment", "VolumeAttachmentList", + "VolumeAttributesClass", + "VolumeAttributesClassList", "WatchEvent", } From 131b0d67bd2e0f1a02e0daf2f3460482221ce3c0 Mon Sep 17 00:00:00 2001 From: Loukas Agorgianitis Date: Sun, 14 Jul 2024 23:52:15 +0300 Subject: [PATCH 3/3] Fix settings update before `workspace/didChangeConfiguration` notification (#50) --- 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