Myzel394 / jsonfly.nvim

❴🦋❵ Fly through your JSON / XML / YAML files with ease. Search ✨ blazingly fast ✨ for keys via Telescope.
125 stars 2 forks source link

Can't index key #1

Closed joshuadanpeterson closed 2 months ago

joshuadanpeterson commented 2 months ago

I followed the installation instructions to the T, but when I run :Telescope jsonfly I get this error:

E5108: Error executing lua: vim/_editor.lua:0: nvim_exec2(): Vim:Error executing Lua callback: .../lazy/jsonfly.nvim/lua/telescope/_extensions/jsonfly.lua:154: attempt to index field 'key' (a number value)
stack traceback:
    .../lazy/jsonfly.nvim/lua/telescope/_extensions/jsonfly.lua:154: in function 'entry_maker'
    ...scope.nvim/lua/telescope/finders/async_static_finder.lua:17: in function 'new_table'
    .../lazy/jsonfly.nvim/lua/telescope/_extensions/jsonfly.lua:151: in function <.../lazy/jsonfly.nvim/lua/telescope/_extensions/jsonfly.lua:131>
    ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:193: in function 'run_command'
    ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:259: in function 'load_command'
    ...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:108: in function <...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:107>
    [C]: in function 'nvim_exec2'
    vim/_editor.lua: in function 'cmd'
    /Users/joshpeterson/.config/nvim/lua/config/keymaps.lua:103: in function </Users/joshpeterson/.config/nvim/lua/config/keymaps.lua:101>
stack traceback:
    [C]: in function 'nvim_exec2'
    vim/_editor.lua: in function 'cmd'
    /Users/joshpeterson/.config/nvim/lua/config/keymaps.lua:103: in function </Users/joshpeterson/.config/nvim/lua/config/keymaps.lua:101>
Myzel394 commented 2 months ago

Can you share the JSON file you are working on?

joshuadanpeterson commented 2 months ago

This is what I'm working on:

[ { "icon": "wi-moon-waxing-crescent-1", "phase": "Waxing Crescent Moon" }, { "icon": "wi-moon-waxing-crescent-2", "phase": "Waxing Crescent Moon" }, { "icon": "wi-moon-waxing-crescent-3", "phase": "Waxing Crescent Moon" }, { "icon": "wi-moon-waxing-crescent-4", "phase": "Waxing Crescent Moon" }, { "icon": "wi-moon-waxing-crescent-5", "phase": "Waxing Crescent Moon" }, { "icon": "wi-moon-waxing-crescent-6", "phase": "Waxing Crescent Moon" }, { "icon": "wi-moon-first-quarter", "phase": "First Quarter Moon" }, { "icon": "wi-moon-waxing-gibbous-1", "phase": "Waxing Gibbous Moon" }, { "icon": "wi-moon-waxing-gibbous-2", "phase": "Waxing Gibbous Moon" }, { "icon": "wi-moon-waxing-gibbous-3", "phase": "Waxing Gibbous Moon" }, { "icon": "wi-moon-waxing-gibbous-4", "phase": "Waxing Gibbous Moon" }, { "icon": "wi-moon-waxing-gibbous-5", "phase": "Waxing Gibbous Moon" }, { "icon": "wi-moon-waxing-gibbous-6", "phase": "Waxing Gibbous Moon" }, { "icon": "wi-moon-full", "phase": "Full Moon" }, { "icon": "wi-moon-waning-gibbous-1", "phase": "Waning Gibbous Moon" }, { "icon": "wi-moon-waning-gibbous-2", "phase": "Waning Gibbous Moon" }, { "icon": "wi-moon-waning-gibbous-3", "phase": "Waning Gibbous Moon" }, { "icon": "wi-moon-waning-gibbous-4", "phase": "Waning Gibbous Moon" }, { "icon": "wi-moon-waning-gibbous-5", "phase": "Waning Gibbous Moon" }, { "icon": "wi-moon-waning-gibbous-6", "phase": "Waning Gibbous Moon" }, { "icon": "wi-moon-third-quarter", "phase": "Third Quarter Moon" }, { "icon": "wi-moon-waning-crescent-1", "phase": "Waning Crescent Moon" }, { "icon": "wi-moon-waning-crescent-2", "phase": "Waning Crescent Moon" }, { "icon": "wi-moon-waning-crescent-3", "phase": "Waning Crescent Moon" }, { "icon": "wi-moon-waning-crescent-4", "phase": "Waning Crescent Moon" }, { "icon": "wi-moon-waning-crescent-5", "phase": "Waning Crescent Moon" }, { "icon": "wi-moon-waning-crescent-6", "phase": "Waning Crescent Moon" }, { "icon": "wi-moon-new", "phase": "New Moon" } ]

Myzel394 commented 2 months ago

Ahh I see, can confirm this is happening. However, if you use the default configuration and update jsonfly, this should be fixed.

I'll still make sure to fix this, but at least you should be able to use jsonfly by just updating it :)

Myzel394 commented 2 months ago

All right this one was an easy one, should now be fixed for both the lua and lsp backend. Make sure to update jsonfly :D

joshuadanpeterson commented 2 months ago

Great, thank you! Works beautifully. Very cool plugin. Thanks again!