Closed marcusramberg closed 2 years ago
It is crashing on a line that merges your custom schemas defined during setup with the LSP ones. Can you update the plugin and post the output of:
:lua print(vim.inspect(require("yaml-companion.config").options))
Your setup is wrong too btw but shouldn't cause it to crash. The Kubernetes support is built-in, so you don't really need to redefine another schema for it unless you need multiple versions. If you want to have "Kubernetes 1.22.4" and "Taskfile" schemas available in Telescope, your setup should look like:
local cfg = require("yaml-companion").setup({
schemas = {
result = {
{
name = "Kubernetes 1.22.4",
uri = "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json",
},
{
name = "Taskfile",
uri = "https://gist.githubusercontent.com/KROSF/c5435acf590acd632f71bb720f685895/raw/6f11aa982ad09a341e20fa7f4beed1a1b2a8f40e/taskfile.schema.json",
}
},
},
})
I couldn't manage to reproduce it, on my end it works as expected with your config block fixed.
Having the same issue here.
{:lua print(vim.inspect(require("yaml-companion.config").options))
builtin_matchers = {
kubernetes = {
enabled = true
}
},
lspconfig = {
flags = {
debounce_text_changes = 150
},
on_attach = <function 1>,
settings = {
redhat = {
telemetry = {
enabled = false
}
},
yaml = {
format = {
enable = true
},
hover = true,
schemaDownload = {
enable = true
},
schemaStore = {
enable = true,
url = "https://www.schemastore.org/api/json/catalog.json"
},
schemas = {},
trace = {
server = "debug"
},
validate = true
}
},
single_file_support = true
},
},
schemas = {}
}
All my plugins are up-to-date.
@erancx can't reproduce it on master and nvim 0.8.0 even with your full config and a minimal init ie only two use blocks, the plugin and packer itself:
return require('packer').startup(function()
use 'wbthomason/packer.nvim'
use {
"someone-stole-my-name/yaml-companion.nvim",
requires = {
{ "neovim/nvim-lspconfig" },
{ "nvim-lua/plenary.nvim" },
{ "nvim-telescope/telescope.nvim" },
},
config = function()
require("telescope").load_extension("yaml_schema")
local cfg = require("yaml-companion").setup({
builtin_matchers = {
kubernetes = {
enabled = true
}
},
lspconfig = {
flags = {
debounce_text_changes = 150
},
settings = {
redhat = {
telemetry = {
enabled = false
}
},
yaml = {
format = {
enable = true
},
hover = true,
schemaDownload = {
enable = true
},
schemaStore = {
enable = true,
url = "https://www.schemastore.org/api/json/catalog.json"
},
schemas = {},
trace = {
server = "debug"
},
validate = true
}
},
single_file_support = true
},
schemas = {},
})
require("lspconfig")["yamlls"].setup(cfg)
end,
}
end)
What is your neovim version? Do you have any other errors on startup? Even with only yaml-companion
enabled (as in my snippet) does it still crashes?
Thanks, after updating my config to the correct syntax and updating to the latest, it's not crashing for me anymore :).
My config looks like this: