Move SQL 2019 extension's notebook code into Azure Data Studio (#4090)

This commit is contained in:
Cory Rivera
2019-02-20 10:55:49 -08:00
committed by GitHub
parent 2dd71cbe26
commit 70838c3e24
66 changed files with 8098 additions and 14 deletions

View File

@@ -9,6 +9,11 @@ import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
import * as os from 'os';
import * as nls from 'vscode-nls';
import { JupyterController } from './jupyter/jupyterController';
import { AppContext } from './common/appContext';
import { ApiWrapper } from './common/apiWrapper';
const localize = nls.loadMessageBundle();
const JUPYTER_NOTEBOOK_PROVIDER = 'jupyter';
@@ -17,6 +22,8 @@ const noNotebookVisible = localize('noNotebookVisible', 'No notebook editor is a
let counter = 0;
export let controller: JupyterController;
export function activate(extensionContext: vscode.ExtensionContext) {
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.new', (connectionId?: string) => {
newNotebook(connectionId);
@@ -37,6 +44,9 @@ export function activate(extensionContext: vscode.ExtensionContext) {
analyzeNotebook(explorerContext);
}));
let appContext = new AppContext(extensionContext, new ApiWrapper());
controller = new JupyterController(appContext);
controller.activate();
}
function newNotebook(connectionId: string) {
@@ -141,4 +151,7 @@ async function analyzeNotebook(oeContext?: sqlops.ObjectExplorerContext): Promis
// this method is called when your extension is deactivated
export function deactivate() {
if (controller) {
controller.deactivate();
}
}