如何在带有VSCode的Jupyter Notebook中使用摘要? [英] How do I use snippets for Jupyter Notebook with VSCode?

查看:126
本文介绍了如何在带有VSCode的Jupyter Notebook中使用摘要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用VSCode一段时间了,此刻,我正在尝试设置摘要以使其正常工作.它们似乎可以与简单的Python(.py)文件一起使用,但不适用于Jupyter Notebook(.ipynb)文件.有什么办法可以使他们一起工作?

I've been using VSCode for a while and at the moment I am trying to set up snippets to work. They seem to work well with simple Python (.py) files but not with Jupyter Notebook (.ipynb) files. Is there any way to make them work together?

代码段就在这里:

"Create a new figure":{
    "scope": "python",
    "prefix": "nf",
    "body": [
        "plt.figure(figsize=(9, 9))",
        "",
        "$1",
        "",
        "plt.show()"
    ]
}

推荐答案

我是此扩展程序的开发人员.从上面的评论看来,答案已经在这里.但只是在这里加上正式的字眼.当前,我们的笔记本编辑器已实现为具有我们自己的编辑器实例的自定义Web视图.这意味着尽管我们已尽最大努力使外观和感觉正确无误,但实际上它并不是主要的VS Code编辑生态系统的一部分.因此,代码片段,按键绑定,VIM扩展名和Ctrl-F搜索等扩展名目前都不是其中的一部分.我们不仅要自己实现其中的一些内容,而且还要与VS Code团队合作,以便将我们的知识带入VS Code编辑器的经验中.如果您想跟踪此工作,我建议您遵循以下github项目: https://github.com/microsoft/vscode-python/issues/7875

I'm a developer on this extension. From the comments above it seems like the answer is already here. But just to put the official word in here. Currently our Notebook Editor is implemented as a custom webview with our own editor instances. Which means that while we have done our best to get lots of the look and feel right it's not really a part of much of the main VS Code editing ecosystem. So things like snippits, keybindings, extensions like the VIM extension and Ctrl-F search are all currently not a part of it. Were looking both at implementing some of those things ourselves as well as working with VS Code team to bring our stuff more into the VS Code editor experience. If you want to track the work on this I'd recommend following the github item here: https://github.com/microsoft/vscode-python/issues/7875

这篇关于如何在带有VSCode的Jupyter Notebook中使用摘要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆