nidu / vscode-copy-json-path Goto Github PK
View Code? Open in Web Editor NEWVSCode extension: copy path to current json node
License: MIT License
VSCode extension: copy path to current json node
License: MIT License
No context option (on right click), in .js files and js code.
Some examples I tried:
const person = {
name: "Alice",
age: 20,
};
console.log({
name: "Alice",
age: 20,
});
In Python, everything is accessed via subscripts, no dot notation. Please add a configuration option to make it so all object paths use subscripting. Thank you
This extension has been a godsend for copying JSON paths from translations files for i18n, however in our project's configuration, we use colons :
to delimit between path elements instead of .
by default.
It would be amazing if this were configurable to accept any character rather that period .
I've been trying to figure out a good way to get the JSON path from the cursor position and this does it really well.
I was hoping if this was made into an npm package then I'd be able to use it.
I'm open to helping set it up if that's a concern.
Linux Mint v17
VSCode v1.12.2
Tested in valid json, tried multiple cursor positions.
Hi, would you consider adding yaml support? I actually think this maybe used to work, perhaps on accident, but I could be hallucinating.
Related: redhat-developer/vscode-yaml#999
Whenever I right click and try to copy the path it says Couldn't copy path.
Unfortunately the error is not more verbose than that. How can I go about debugging this?
I mainly use this extension for copying JSON dot-notation paths from locale json file to JS - usually these are used inside a string in a function, a-la:
// JSON
"globals": {
"ok-label": "OK",
"cancel": "Cancel"
}
// Usage:
t('globals.ok-label', 'OK')
Currently, the extension copies paths with invalid chars (specifically -
in my case) and wraps these segments in ["
and "]
(e.g. copying "ok-label" from the above JSON would copy globals["ok-label"]
.
It would be really cool to have some option to change this so the escaping isn't done automatically - I would like to copy globals.ok-label
instead.
Thanks for a great extension!
Hi thanks for the extension. I couldn't make it work for the quotes. What should I write in Copy JSON Path: Non Quoted Key Regex
field to use quotes?
I want this
json_data["entry"][0]["changes"][0]["value"]
Instead of this
json_data.entry[0].changes[0].value
Could you get it to copy the path within a js object?
Hi can you push your extension to https://open-vsx.org/ in addition to VSCode Market Place so people using the FLOSS version could install it too?
I wrote an article on the subject.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.