Is it possible to copy a path in a JSON file? For example in this file:
{
"a": {
"b": {
"c": "keyC"
}
}
}
when I am on a "keyC"
and I would press some hotkey, I'd get an a.b.c
string in the clipboard.
Copy pathsPress Ctrl+Shift+C to copy the absolute path to the current file. Choose Edit | Copy Path/Reference from the main menu. In the popup that opens, choose what part of the path you want to copy — filename, absolute, or relative path.
Usage: Paste JSON string into editor, and press Reformat Code (Ctrl + Alt + L in windows) to format code as if you editing a file with . json suffix. The plugin panel will appear on the right side of the window after installed, and you don't have to restart the IDE.
I know this post is old, but I thought I'd give an updated answer.
I came across this question because I was looking for the same thing, then discovered the feature actually exists in WebStorm already (I'm assuming it exists in IntelliJ as well).
Basically, put your cursor on the node you want, and you'll see the path at the bottom of the editor window. Then you can right-click on the path and select "Copy qualified name to clipboard".
Here's an example of doing this from my IDE:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With