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

Can not add snippet #255

Open
Erimus-Koo opened this issue Jul 5, 2023 · 2 comments
Open

Can not add snippet #255

Erimus-Koo opened this issue Jul 5, 2023 · 2 comments

Comments

@Erimus-Koo
Copy link

Describe the bug
Add snippet by creating new or dragging, console raise an error:
image

  1. Installed in Extension Manager, get a blank panel.
  2. Remove the Extension Manager version
  3. Installed by pip
  4. Panel appears, but can not add.
@genzj
Copy link

genzj commented Aug 16, 2023

+1, same problem here. I think it has something to do with the setting initialization but not sure. Here is a workaround at least making the plugin usable: editing ~/.jupyter/lab/user-settings/jupyterlab-code-snippets/snippets.jupyterlab-settings and manually add at least one snippet to the snippets key of the config. The edited file may look like:

{
    // Code Snippet Manager
    // jupyterlab-code-snippets:snippets
    // Code Snippet Manager Settings
    // *********************************

    // Font Size of Preview
    // Change the font size of preview to see its content
    "snippetPreviewFontSize": 3,

    // List of code snippets
    // A snippet is defined by a 'id', 'name', and 'language'
    "snippets": [
        {
            "name": "placeholder",
            "description": "placeholder",
            "language": "python",
            "code": "nothing",
            "id": 0,
            "tags": [
                "nothing"
            ]
        }
    ]
}

@dangarciahe
Copy link

Thanks, this workaround still works as of Jupyterlab Version 4.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants