mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Create book dialog improvements (#14429)
* add improvements TODO on creating book experience * fix create book to support a more complex folder structure * replace \\ to a forward slash on windows * address pr comments * fix tests * use the posix version of path.sep
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as path from 'path';
|
||||
|
||||
import { JupyterController } from './jupyter/jupyterController';
|
||||
import { AppContext } from './common/appContext';
|
||||
@@ -31,7 +30,6 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
|
||||
IconPathHelper.setExtensionContext(extensionContext);
|
||||
|
||||
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.
|
||||
@@ -60,14 +58,7 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
|
||||
}));
|
||||
|
||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.createBook', async () => {
|
||||
let untitledFileName: vscode.Uri = vscode.Uri.parse(`untitled:${createBookPath}`);
|
||||
await vscode.workspace.openTextDocument(createBookPath).then((document) => {
|
||||
azdata.nb.showNotebookDocument(untitledFileName, {
|
||||
connectionProfile: null,
|
||||
initialContent: document.getText(),
|
||||
initialDirtyState: false
|
||||
});
|
||||
});
|
||||
await bookTreeViewProvider.createBook();
|
||||
}));
|
||||
|
||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.moveTo', async (book: BookTreeItem) => {
|
||||
|
||||
Reference in New Issue
Block a user