json-viewer icon indicating copy to clipboard operation
json-viewer copied to clipboard

JSON path for current selection

Open jruddell opened this issue 8 years ago • 6 comments

Could we add the current JSON selector for the current caret/cursor/selection position? Meaning

some_item: [
    {
        id: 1,
        something: something,
        url: https://www.some/url/here.com
    },
    {
        id: 2,
        something: something,
        url: https://www.some/url/here.com
    },
    {
        id: 3,
        something: something,
        url: https://www.some/url/here.com
    },
    {
        id: 4,
        something: something,
        url: https://www.some/url/here.com
    }
]

if my caret/selection was over the url property in the object with id # 2 then some indicator (maybe at the top or bottom of the screen) shows the current json selector for that element (some_item[1].url)

jruddell avatar Dec 31 '15 23:12 jruddell

That's a good idea

tulios avatar Jan 18 '16 17:01 tulios

Yes please, can we get this?

javamonkey79 avatar Nov 23 '16 01:11 javamonkey79

Main thing I miss from old JSONView is the ability to see the path in the status bar, and easily copy the path or value via right-click.

I now switch between using JSON Formatter and JSON Viewer, but far as I can tell neither offer that old beloved feature. Would love to see it in JSON Viewer!

jsonview path and value

alahosky avatar Feb 10 '17 08:02 alahosky

Hi @alahosky, I like this feature as well, bear with me :) Right now I'm trying to fix all bugs and corner cases but I keep improving the extension and adding new features from time to time.

tulios avatar Feb 10 '17 08:02 tulios

This would be great, indeed!

Currently my workaround for this is to paste the JSON in VS Code and get the path via JSONPath plugin, but that is unnecessarily tedious. :(

isavcic avatar Feb 16 '18 11:02 isavcic

Beside show and copy the path, I really want to copy the value (useful in long json document). I think no one want to scroll to select 100 lines then press Ctrl+C. Another problem is that, sometime I'm not sure if I am selecting the correct start and end lines of the same item.

xuanswe avatar Feb 13 '20 09:02 xuanswe