Closed Kiryonn closed 2 months ago
Hmmm, interesting idea. I deliberately made my PPrint
pretty-printing algorithm as simple as possible because I didn't feel like dealing with the added complexity of so many extra knobs to turn, but your suggestion sounds reasonable.
The main issue I see with your idea is figuring out a good way to communicate it to users.
Thanks for your feedback.
My current inclination is not to add a new setting, but add a new way to selectively pretty-print or compress only some arrays/objects without changing the formatting of the rest of the document.
Still not sure of the exact implementation, but probably what I will do is add some options to the right-click menu when right-clicking on a location that has a json node. These right-click options might include path to current location, pretty-print just this node, and compress just this node.
Don't be surprised if it takes me a while to get around to this. I'm currently working on an irritating refactor of RemesPath.
Take your time champ, I'm not the kind that complains to hard working people
My new ability to parse multiple selections isn't exactly what you're looking for, but it can help:
[
[
0,
0,
0
],
[
1,
2,
3
],
[
2,
4,
6
],
[
3,
6,
9
],
[
4,
8,
12
]
]
can just be multi-selected (by selecting everything after the opening square brace and then using the Select every valid JSON in selection
command) and compressed to convert it into this:
[
[0,0,0],
[1,2,3],
[2,4,6],
[3,6,9],
[4,8,12]
]
Multi-selecting only certain JSON in a document just got a lot easier, thanks to the new select JSON or JSON's children from treeview feature.
I won't go into too much detail, but basically you can select only a certain JSON element (or its children) and then pretty-print or compress those selections independently from the rest of the document. This goes most of the rest of towards making this sort of manipulation easy, and I'm not particularly inclined to continue working on this in the near future.
I am closing this issue, and have no intention of implementing any feature that I previously mentioned considering. See #61 for a relevant tutorial.
basically making that thing:
into this: