JSON-Viewer
JSON-Viewer copied to clipboard
Copy value from JSON Viewer
It'd be awesome if you could copy the value directly from the JSON viewer object.
Flow would be something like
- Right click object in JSON Viewer
- Click Copy
- Viola
Good feature! will work on it
@SinghRajenM Can you help with this feature? There is a branch node_click_action which has WIP. I am stuck at creating rapidjson DOM object using a SAX stream.
@kapilratnani, Sure, I will check it and update you.
@kapilratnani,
I have one query about the behavior of copy function.
Consider, the above screenshot. What should happen?
When user clicks the highlighted marks 1 and 3 under node 0? As per me: No action.
When user clicks the highlighted marks 2 and 4 under node 0? As per me: On 2: copy => "display-name: switcher" and on 4: copy => "Name: Rajen"
Or let me know if the expectation is something else.
When one clicks on the node and clicks Copy the object under should get copied to clipboard as JSON text. For Ex: When copy is selected on the right click menu on the mark 1 clipboard should have: { "folder-name":"switcher", .... }
I had written the logic which was as follows:
- Create a DOM object using the rapidjson SAX stream
- on each node in the tree view store path string using lparam. (path string: "/a/b/c")
- when selected to Copy, get path string from the tree view node
- use the path string to extract object from the DOM object created in 1.
It seems i haven't pushed the code in the branch, will do it.
@visch , I am developing this feature and it is almost complete. Would you please mind if I ask you to test it and provide any early feedback?
Please note: currently, it copies node name, value, and path. Will try to extend it to copy the while array/object in near future.
How to test
- Download binary from build room
https://ci.appveyor.com/project/kapilratnani/json-viewer
as appropriate e.g. win32 or x64 or ARM64 - Open Notepad++
plugin folder
- Open
plugin folder
, go toPlugins
menu on Notepad++ - Click on
Open Plugins Folder
- Open
- Navigate to
NPPJSONViewer
and rename the existingNPPJSONViewer.dll
for backup. - Copy the downloaded binary (in step # 1) to
NPPJSONViewer
folder. - Run some test
- Once done, restore the backup. To restore,
- Delete the new file (
NPPJSONViewer.dll
) - Rename the old file to
NPPJSONViewer.dll
- Now backup is restored.
- Delete the new file (
@visch , I am developing this feature and it is almost complete. Would you please mind if I ask you to test it and provide any early feedback?
Please note: currently, it copies node name, value, and path. Will try to extend it to copy the while array/object in near future.
How to test
Download binary from build room
https://ci.appveyor.com/project/kapilratnani/json-viewer
as appropriate e.g. win32 or x64 or ARM64Open Notepad++
plugin folder
- Open
plugin folder
, go toPlugins
menu on Notepad++- Click on
Open Plugins Folder
Navigate to
NPPJSONViewer
and rename the existingNPPJSONViewer.dll
for backup.Copy the downloaded binary (in step # 1) to
NPPJSONViewer
folder.Run some test
Once done, restore the backup. To restore,
- Delete the new file (
NPPJSONViewer.dll
)- Rename the old file to
NPPJSONViewer.dll
- Now backup is restored.
Slight issue with the Json Viewer not working until I hit the refresh button. Video here (uploaded as the link before didn't work)
https://user-images.githubusercontent.com/8680264/191601065-bf41b378-c6b1-465c-af3c-4fed0cf2517c.mp4
Other than that (and the array issue) it looks to be working!
@visch Thanks for sparing some time and testing it.
Slight issue with the Json Viewer not working until I hit the refresh button. Video here (uploaded as the link before didn't work)
What Noptepad++ version do you use? I'm unable to reproduce it with Notepad++ v8.4.5 (64-bit)
. I will check 32 bit as well.