Skip to content

Feature request: Save snippets with indented/pretty printed JSON #212

Open
@dhendry

Description

@dhendry

Is your feature request related to a problem? Please describe.

Snippet JSON files are serialized as a single line which makes them nearly impossible to manage via source control. When using tools like git any change results in an unusable diff since it appears 'everything' has changed and its difficult or impossible to manage conflicts

Describe the solution you'd like

When saving snippet json files to disk (or exporting), export them with indents.

I believe this is as simple as changing JSON.stringify(snippet) to JSON.stringify(snippet, null, 4) although I have not had a chance to test it:

https://github.com/jupytercalpoly/jupyterlab-code-snippets/search?q=JSON.stringify

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions