Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Having a minimum length in an array before pretty printing it #39

Closed
Kiryonn opened this issue Jun 20, 2023 · 6 comments
Labels
enhancement New feature or request probably fixed? the issue/feature appears to be fixed/implemented, but there still may be issues wontfix This will not be worked on

Comments

@Kiryonn
Copy link

Kiryonn commented Jun 20, 2023

basically making that thing:

{
    "inputs": "#_#_",
    "values": [
        [
            11,
            15
        ],
        [
            16,
            15
        ],
        [
            11,
            17
        ],
        [
            16,
            17
        ],
        [
            13,
            25
        ]
    ]
}

into this:

{
    "inputs": "#_#_",
    "values": [
        [11, 15],
        [16, 15],
        [11, 17],
        [16, 17],
        [13, 25]
    ]
}
@molsonkiko
Copy link
Owner

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.

@molsonkiko molsonkiko added the enhancement New feature or request label Jun 20, 2023
@molsonkiko
Copy link
Owner

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.

@Kiryonn
Copy link
Author

Kiryonn commented Jun 22, 2023

Take your time champ, I'm not the kind that complains to hard working people

@molsonkiko
Copy link
Owner

molsonkiko commented Aug 14, 2023

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]
]

@molsonkiko
Copy link
Owner

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.

@molsonkiko molsonkiko added the probably fixed? the issue/feature appears to be fixed/implemented, but there still may be issues label Nov 1, 2023
@molsonkiko molsonkiko added the wontfix This will not be worked on label Apr 18, 2024
@molsonkiko
Copy link
Owner

I am closing this issue, and have no intention of implementing any feature that I previously mentioned considering. See #61 for a relevant tutorial.

@molsonkiko molsonkiko closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request probably fixed? the issue/feature appears to be fixed/implemented, but there still may be issues wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants