[英]How does VSCode's Remote Extension open files in my local editor through its internal terminal?
[英]How to open a *.ipynb file editor through vscode extension API?
如何通过 VSCode 扩展 API 在 VSCode 扩展中使用 Jupyter Notebook 编辑器从文件的 url 打开现有的 *.ipynb 文件?
有一个vscode.window.showTextDocument
API。笔记本文件是否有任何等效的 API,如showNotebookDocument
?
例如
const filePath = 'path/to/notebook.ipynb';
vscode.workspace.openNotebookDocument(vscode.Uri.file(filePath)).then((doc) => {
vscode.window.showNotebookDocument(doc);
});
刚刚找到我的答案
vscode.commands.executeCommand("vscode.openWith", vscode.Uri.file(filePath), 'jupyter-notebook');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.