Skip to content

Commit

Permalink
chore/remove-deprecated-apis
Browse files Browse the repository at this point in the history
  • Loading branch information
mosheavni committed Jul 15, 2024
1 parent 1944149 commit 7db9bf1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
2 changes: 2 additions & 0 deletions lua/yaml-companion/builtin/kubernetes/resources.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ return {
"CSIStorageCapacityList",
"CertificateSigningRequest",
"CertificateSigningRequestList",
"ClusterCIDR",
"ClusterCIDRList",
"ClusterRole",
"ClusterRoleBinding",
"ClusterRoleBindingList",
Expand Down
13 changes: 0 additions & 13 deletions lua/yaml-companion/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,6 @@ function M.setup(options, on_attach)

M.options.lspconfig.on_attach = add_hook_after(options.lspconfig.on_attach, on_attach)

local all_schemas = vim.deepcopy(M.options.schemas)
local collected_uris = {}
M.options.schemas = {}
for _, schema in pairs(all_schemas) do
if not schema.uri then
schema.uri = schema.url
end
if not collected_uris[schema.uri] then
vim.list_extend(M.options.schemas, { schema })
collected_uris[schema.uri] = true
end
end

M.options.lspconfig.on_init = add_hook_after(options.lspconfig.on_init, function(client)
client.notify("yaml/supportSchemaSelection", { {} })
return true
Expand Down
2 changes: 1 addition & 1 deletion lua/yaml-companion/context/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ M.schema = function(bufnr, new_schema)
new_schema = new_schema.result[1]
end

if new_schema and new_schema.uri then
if new_schema and new_schema.uri and new_schema.name then
M.ctxs[bufnr].schema = new_schema

local bufuri = vim.uri_from_bufnr(bufnr)
Expand Down

0 comments on commit 7db9bf1

Please sign in to comment.