From 4cc3a3f7885db47330c23abe99e7bb4c9c01f384 Mon Sep 17 00:00:00 2001 From: Laura Jiang <39676345+laurajjiang@users.noreply.github.com> Date: Thu, 3 Sep 2020 21:54:34 -0700 Subject: [PATCH] Provide bookTreeView comment to ensure compatibility (#12122) * compatibility comment * add importance --- extensions/notebook/src/extension.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/notebook/src/extension.ts b/extensions/notebook/src/extension.ts index 247572162c..e22d29adb0 100644 --- a/extensions/notebook/src/extension.ts +++ b/extensions/notebook/src/extension.ts @@ -26,6 +26,11 @@ type ChooseCellType = { label: string, id: CellType }; export async function activate(extensionContext: vscode.ExtensionContext): Promise { const appContext = new AppContext(extensionContext); const createBookPath: string = path.posix.join(extensionContext.extensionPath, 'resources', 'notebooks', 'JupyterBooksCreate.ipynb'); + /** + * ***** IMPORTANT ***** + * If changes are made to bookTreeView.openBook, please ensure backwards compatibility with its current state. + * This is the command used in the extension generator to open a Jupyter Book. + */ extensionContext.subscriptions.push(vscode.commands.registerCommand('bookTreeView.openBook', (bookPath: string, openAsUntitled: boolean, urlToOpen?: string) => openAsUntitled ? providedBookTreeViewProvider.openBook(bookPath, urlToOpen, true) : bookTreeViewProvider.openBook(bookPath, urlToOpen, true))); extensionContext.subscriptions.push(vscode.commands.registerCommand('bookTreeView.openNotebook', (resource) => bookTreeViewProvider.openNotebook(resource))); extensionContext.subscriptions.push(vscode.commands.registerCommand('bookTreeView.openUntitledNotebook', (resource) => providedBookTreeViewProvider.openNotebookAsUntitled(resource)));