jsonpath.nvim
jsonpath.nvim copied to clipboard
initial commit for yaml support
First attempt at YAML support. Choice of yaml or json parsing is made based on filetype which can be explicitly set, if needed:
:set filetype=yaml
Related: https://github.com/phelipetls/jsonpath.nvim/issues/1
Also, it might be necessary to add yaml to treesitter:
require 'nvim-treesitter.configs'.setup {
ensure_installed = { "yaml"},
}
If this gets too complicated I opened a PR for similar functionality to enable winbar to yaml.nvim
https://github.com/cuducos/yaml.nvim/pull/25
I don't know how good yaml.nvim is when it comes to parsing, but it seems to work for my use case. If you wanted to keep to just json logic here and point people to yaml.nvim.
Thanks @joshzcold, that's a good recommendation.
YAML is much more complicated and I think the current implementation is hacky enough for JSON, so I'm not 100% comfortable extending support to YAML.