Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Loading Snippets in *.ipynb #3

Open
tklosek0 opened this issue Aug 31, 2020 · 4 comments
Open

Loading Snippets in *.ipynb #3

tklosek0 opened this issue Aug 31, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@tklosek0
Copy link

Hello!
I want to ask, if it is possible to load the snippets in *.ipynb files?
Im running an Matlab_Kernel in Jupyter Notebook, and it would be nice to edit the extension to load in *.ipynb files instead of only in *.m files.

I know that it would load if I would use python in *.ipynb, but im currently only working with Matlab.
Optimal would be an entry which I can edit if I want to use Python/Matlab.
I dont know how to edit the extension-file to let the snippets load in that *.ipynb file-extension.

Thanks!

@slaier slaier added the enhancement New feature or request label Aug 31, 2020
@slaier
Copy link
Owner

slaier commented Sep 2, 2020

It seems that extension is not working on jupyter notebook.

microsoft/vscode#34739

@tklosek0
Copy link
Author

No, Im already running an Matlab_Kernel inside an Jupyter Notebook in Vscode.
My question was, if it is possible to load your extension also with *.ipynb file-types.

For *.m files, the extension offer all snippets, but I want them also in *.ipynb files.
How do I activate the Snippets-Extension on other-filetypes too?

@tklosek0
Copy link
Author

tklosek0 commented Nov 14, 2020

I think it might be necessary to edit following file Package.json
in Line 21,27.

slaier added a commit that referenced this issue Nov 18, 2020
@slaier
Copy link
Owner

slaier commented Nov 18, 2020

Please download release MatlabSnippetsPY-x.x.x.vsix

and follow this answer: https://stackoverflow.com/a/62061334

It is not possible to use user snippets in the Jupyter extension (yet), you can however use interactive python. When you write # %% in a normal .py file this is like opening a new Jupyter cell. You can convert a Jupyter notebook into a python file and it will use interactive python. There you will be able to use your snippets.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants