jsonpath.nvim icon indicating copy to clipboard operation
jsonpath.nvim copied to clipboard

initial commit for yaml support

Open oneubauer opened this issue 1 year ago • 3 comments

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

oneubauer avatar May 02 '23 17:05 oneubauer

Also, it might be necessary to add yaml to treesitter:

require 'nvim-treesitter.configs'.setup {
  ensure_installed = { "yaml"},
 }

oneubauer avatar May 02 '23 17:05 oneubauer

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.

joshzcold avatar Oct 30 '23 17:10 joshzcold

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.

phelipetls avatar Oct 30 '23 18:10 phelipetls