jupyterlab-code-snippets icon indicating copy to clipboard operation
jupyterlab-code-snippets copied to clipboard

Allow globally defined snippets in overrides.json

Open m4dh4t opened this issue 1 year ago • 0 comments

Currently if we want to provide JupyterLab's users globally defined snippets by setting them inside <sys.prefix>/local/share/jupyter/lab/settings/overrides.json (see JupyterLab's documentation), these are ignored until manually set inside ~/.jupyter/lab/user-settings/jupyterlab-code-snippets/snippets.jupyterlab-settings via the widget or the settings GUI.

The goal of this commit is to allow snippets initialization through extension overridden settings without user interaction at Lab startup.

Dummy overrides.json example:

{
    "jupyterlab-code-snippets:snippets": {
        "snippets": [
            {
                "id": 1,
                "tags": [],
                "name": "Hello World",
                "language": "Python",
                "code": "print('Hello, World!')"
            }
        ]
    }
}

m4dh4t avatar Mar 31 '23 17:03 m4dh4t