mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Update product references from 'sqlops' to 'azdata' (#4259)
* Update extensions to use azdata * Switch core code to use azdata
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
/**
|
||||
* Wrapper class to act as a facade over VSCode and Data APIs and allow us to test / mock callbacks into
|
||||
@@ -24,8 +24,8 @@ export class ApiWrapper {
|
||||
return vscode.window.createTerminal(options);
|
||||
}
|
||||
|
||||
public getCurrentConnection(): Thenable<sqlops.connection.Connection> {
|
||||
return sqlops.connection.getCurrentConnection();
|
||||
public getCurrentConnection(): Thenable<azdata.connection.ConnectionProfile> {
|
||||
return azdata.connection.getCurrentConnection();
|
||||
}
|
||||
|
||||
public getWorkspacePathFromUri(uri: vscode.Uri): string | undefined {
|
||||
@@ -41,8 +41,8 @@ export class ApiWrapper {
|
||||
return vscode.languages.registerCompletionItemProvider(selector, provider, ...triggerCharacters);
|
||||
}
|
||||
|
||||
public registerTaskHandler(taskId: string, handler: (profile: sqlops.IConnectionProfile) => void): void {
|
||||
sqlops.tasks.registerTask(taskId, handler);
|
||||
public registerTaskHandler(taskId: string, handler: (profile: azdata.IConnectionProfile) => void): void {
|
||||
azdata.tasks.registerTask(taskId, handler);
|
||||
}
|
||||
|
||||
public showErrorMessage(message: string, ...items: string[]): Thenable<string | undefined> {
|
||||
@@ -53,8 +53,8 @@ export class ApiWrapper {
|
||||
return vscode.window.showOpenDialog(options);
|
||||
}
|
||||
|
||||
public startBackgroundOperation(operationInfo: sqlops.BackgroundOperationInfo): void {
|
||||
sqlops.tasks.startBackgroundOperation(operationInfo);
|
||||
public startBackgroundOperation(operationInfo: azdata.BackgroundOperationInfo): void {
|
||||
azdata.tasks.startBackgroundOperation(operationInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as fs from 'fs';
|
||||
import * as utils from '../common/utils';
|
||||
|
||||
@@ -17,7 +17,7 @@ import JupyterServerInstallation from '../jupyter/jupyterServerInstallation';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class ConfigurePythonDialog {
|
||||
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||
private dialog: azdata.window.modelviewdialog.Dialog;
|
||||
|
||||
private readonly DialogTitle = localize('configurePython.dialogName', 'Configure Python for Notebooks');
|
||||
private readonly OkButtonText = localize('configurePython.okButtonText', 'Install');
|
||||
@@ -28,14 +28,14 @@ export class ConfigurePythonDialog {
|
||||
private readonly InstallationNote = localize('configurePython.installNote', 'This installation will take some time. It is recommended to not close the application until the installation is complete.');
|
||||
private readonly InvalidLocationMsg = localize('configurePython.invalidLocationMsg', 'The specified install location is invalid.');
|
||||
|
||||
private pythonLocationTextBox: sqlops.InputBoxComponent;
|
||||
private browseButton: sqlops.ButtonComponent;
|
||||
private pythonLocationTextBox: azdata.InputBoxComponent;
|
||||
private browseButton: azdata.ButtonComponent;
|
||||
|
||||
constructor(private appContext: AppContext, private outputChannel: vscode.OutputChannel, private jupyterInstallation: JupyterServerInstallation) {
|
||||
}
|
||||
|
||||
public async showDialog() {
|
||||
this.dialog = sqlops.window.modelviewdialog.createDialog(this.DialogTitle);
|
||||
this.dialog = azdata.window.modelviewdialog.createDialog(this.DialogTitle);
|
||||
|
||||
this.initializeContent();
|
||||
|
||||
@@ -44,19 +44,19 @@ export class ConfigurePythonDialog {
|
||||
|
||||
this.dialog.registerCloseValidator(() => this.handleInstall());
|
||||
|
||||
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
||||
azdata.window.modelviewdialog.openDialog(this.dialog);
|
||||
}
|
||||
|
||||
private initializeContent() {
|
||||
this.dialog.registerContent(async view => {
|
||||
this.pythonLocationTextBox = view.modelBuilder.inputBox()
|
||||
.withProperties<sqlops.InputBoxProperties>({
|
||||
.withProperties<azdata.InputBoxProperties>({
|
||||
value: JupyterServerInstallation.getPythonInstallPath(this.appContext.apiWrapper),
|
||||
width: '100%'
|
||||
}).component();
|
||||
|
||||
this.browseButton = view.modelBuilder.button()
|
||||
.withProperties<sqlops.ButtonProperties>({
|
||||
.withProperties<azdata.ButtonProperties>({
|
||||
label: this.BrowseButtonText,
|
||||
width: '100px'
|
||||
}).component();
|
||||
@@ -158,14 +158,14 @@ export class ConfigurePythonDialog {
|
||||
private showInfoMessage(message: string) {
|
||||
this.dialog.message = {
|
||||
text: message,
|
||||
level: sqlops.window.modelviewdialog.MessageLevel.Information
|
||||
level: azdata.window.modelviewdialog.MessageLevel.Information
|
||||
};
|
||||
}
|
||||
|
||||
private showErrorMessage(message: string) {
|
||||
this.dialog.message = {
|
||||
text: message,
|
||||
level: sqlops.window.modelviewdialog.MessageLevel.Error
|
||||
level: azdata.window.modelviewdialog.MessageLevel.Error
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as os from 'os';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
@@ -40,7 +40,7 @@ export function activate(extensionContext: vscode.ExtensionContext) {
|
||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addtext', () => {
|
||||
addCell('markdown');
|
||||
}));
|
||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.analyzeNotebook', (explorerContext: sqlops.ObjectExplorerContext) => {
|
||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.analyzeNotebook', (explorerContext: azdata.ObjectExplorerContext) => {
|
||||
analyzeNotebook(explorerContext);
|
||||
}));
|
||||
|
||||
@@ -52,7 +52,7 @@ export function activate(extensionContext: vscode.ExtensionContext) {
|
||||
function newNotebook(connectionId: string) {
|
||||
let title = `Untitled-${counter++}`;
|
||||
let untitledUri = vscode.Uri.parse(`untitled:${title}`);
|
||||
let options: sqlops.nb.NotebookShowOptions = connectionId ? {
|
||||
let options: azdata.nb.NotebookShowOptions = connectionId ? {
|
||||
viewColumn: null,
|
||||
preserveFocus: true,
|
||||
preview: null,
|
||||
@@ -60,7 +60,7 @@ function newNotebook(connectionId: string) {
|
||||
connectionId: connectionId,
|
||||
defaultKernel: null
|
||||
} : null;
|
||||
sqlops.nb.showNotebookDocument(untitledUri, options).then(success => {
|
||||
azdata.nb.showNotebookDocument(untitledUri, options).then(success => {
|
||||
|
||||
}, (err: Error) => {
|
||||
vscode.window.showErrorMessage(err.message);
|
||||
@@ -86,7 +86,7 @@ async function openNotebook(): Promise<void> {
|
||||
|
||||
async function runActiveCell(): Promise<void> {
|
||||
try {
|
||||
let notebook = sqlops.nb.activeNotebookEditor;
|
||||
let notebook = azdata.nb.activeNotebookEditor;
|
||||
if (notebook) {
|
||||
await notebook.runCell();
|
||||
} else {
|
||||
@@ -97,11 +97,11 @@ async function runActiveCell(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
async function addCell(cellType: sqlops.nb.CellType): Promise<void> {
|
||||
async function addCell(cellType: azdata.nb.CellType): Promise<void> {
|
||||
try {
|
||||
let notebook = sqlops.nb.activeNotebookEditor;
|
||||
let notebook = azdata.nb.activeNotebookEditor;
|
||||
if (notebook) {
|
||||
await notebook.edit((editBuilder: sqlops.nb.NotebookEditorEdit) => {
|
||||
await notebook.edit((editBuilder: azdata.nb.NotebookEditorEdit) => {
|
||||
// TODO should prompt and handle cell placement
|
||||
editBuilder.insertCell({
|
||||
cell_type: cellType,
|
||||
@@ -116,12 +116,12 @@ async function addCell(cellType: sqlops.nb.CellType): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
async function analyzeNotebook(oeContext?: sqlops.ObjectExplorerContext): Promise<void> {
|
||||
async function analyzeNotebook(oeContext?: azdata.ObjectExplorerContext): Promise<void> {
|
||||
// Ensure we get a unique ID for the notebook. For now we're using a different prefix to the built-in untitled files
|
||||
// to handle this. We should look into improving this in the future
|
||||
let untitledUri = vscode.Uri.parse(`untitled:Notebook-${counter++}`);
|
||||
|
||||
let editor = await sqlops.nb.showNotebookDocument(untitledUri, {
|
||||
let editor = await azdata.nb.showNotebookDocument(untitledUri, {
|
||||
connectionId: oeContext ? oeContext.connectionProfile.id : '',
|
||||
providerId: JUPYTER_NOTEBOOK_PROVIDER,
|
||||
preview: false,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import * as should from 'should';
|
||||
import * as assert from 'assert';
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as tempWrite from 'temp-write';
|
||||
import 'mocha';
|
||||
|
||||
@@ -42,13 +42,13 @@ describe('Notebook Integration Test', function (): void {
|
||||
let uri = writeNotebookToFile(pythonNotebook);
|
||||
await ensureJupyterInstalled();
|
||||
|
||||
let notebook = await sqlops.nb.showNotebookDocument(uri);
|
||||
let notebook = await azdata.nb.showNotebookDocument(uri);
|
||||
should(notebook.document.cells).have.length(1);
|
||||
let ran = await notebook.runCell(notebook.document.cells[0]);
|
||||
should(ran).be.true('Notebook runCell failed');
|
||||
let cellOutputs = notebook.document.cells[0].contents.outputs;
|
||||
should(cellOutputs).have.length(1);
|
||||
let result = (<sqlops.nb.IExecuteResult>cellOutputs[0]).data['text/plain'];
|
||||
let result = (<azdata.nb.IExecuteResult>cellOutputs[0]).data['text/plain'];
|
||||
should(result).equal('2');
|
||||
|
||||
try {
|
||||
@@ -68,7 +68,7 @@ describe('Notebook Integration Test', function (): void {
|
||||
let connectionId = await connectToSparkIntegrationServer();
|
||||
|
||||
// When I open a Spark notebook and run the cell
|
||||
let notebook = await sqlops.nb.showNotebookDocument(uri, {
|
||||
let notebook = await azdata.nb.showNotebookDocument(uri, {
|
||||
connectionId: connectionId
|
||||
});
|
||||
should(notebook.document.cells).have.length(1);
|
||||
@@ -78,7 +78,7 @@ describe('Notebook Integration Test', function (): void {
|
||||
// Then I expect to get the output result of 1+1, executed remotely against the Spark endpoint
|
||||
let cellOutputs = notebook.document.cells[0].contents.outputs;
|
||||
should(cellOutputs).have.length(4);
|
||||
let sparkResult = (<sqlops.nb.IStreamResult>cellOutputs[3]).text;
|
||||
let sparkResult = (<azdata.nb.IStreamResult>cellOutputs[3]).text;
|
||||
should(sparkResult).equal('2');
|
||||
|
||||
try {
|
||||
@@ -92,7 +92,7 @@ describe('Notebook Integration Test', function (): void {
|
||||
|
||||
async function connectToSparkIntegrationServer(): Promise<string> {
|
||||
assert.ok(process.env.BACKEND_HOSTNAME, 'BACKEND_HOSTNAME, BACKEND_USERNAME, BACKEND_PWD must be set using ./tasks/setbackenvariables.sh or .\\tasks\\setbackendvaraibles.bat');
|
||||
let connInfo: sqlops.connection.Connection = {
|
||||
let connInfo: azdata.connection.Connection = {
|
||||
options: {
|
||||
'host': process.env.BACKEND_HOSTNAME,
|
||||
'groupId': 'C777F06B-202E-4480-B475-FA416154D458',
|
||||
@@ -104,14 +104,14 @@ async function connectToSparkIntegrationServer(): Promise<string> {
|
||||
connectionId: 'abcd1234',
|
||||
};
|
||||
connInfo['savePassword'] = true;
|
||||
let result = await sqlops.connection.connect(<any>connInfo as sqlops.IConnectionProfile);
|
||||
let result = await azdata.connection.connect(<any>connInfo as azdata.IConnectionProfile);
|
||||
|
||||
should(result.connected).be.true();
|
||||
should(result.connectionId).not.be.undefined();
|
||||
should(result.connectionId).not.be.empty();
|
||||
should(result.errorMessage).be.undefined();
|
||||
|
||||
let activeConnections = await sqlops.connection.getActiveConnections();
|
||||
let activeConnections = await azdata.connection.getActiveConnections();
|
||||
should(activeConnections).have.length(1);
|
||||
|
||||
return result.connectionId;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { nb } from 'sqlops';
|
||||
import { nb } from 'azdata';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { charCountToJsCountDiff, jsIndexToCharIndex } from './text';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as path from 'path';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as os from 'os';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -75,22 +75,22 @@ export class JupyterController implements vscode.Disposable {
|
||||
let notebookProvider = undefined;
|
||||
|
||||
notebookProvider = this.registerNotebookProvider();
|
||||
sqlops.nb.onDidOpenNotebookDocument(notebook => {
|
||||
azdata.nb.onDidOpenNotebookDocument(notebook => {
|
||||
if (!JupyterServerInstallation.isPythonInstalled(this.apiWrapper)) {
|
||||
this.doConfigurePython(jupyterInstaller);
|
||||
}
|
||||
});
|
||||
// Add command/task handlers
|
||||
this.apiWrapper.registerTaskHandler(constants.jupyterOpenNotebookTask, (profile: sqlops.IConnectionProfile) => {
|
||||
this.apiWrapper.registerTaskHandler(constants.jupyterOpenNotebookTask, (profile: azdata.IConnectionProfile) => {
|
||||
return this.handleOpenNotebookTask(profile);
|
||||
});
|
||||
this.apiWrapper.registerTaskHandler(constants.jupyterNewNotebookTask, (profile: sqlops.IConnectionProfile) => {
|
||||
this.apiWrapper.registerTaskHandler(constants.jupyterNewNotebookTask, (profile: azdata.IConnectionProfile) => {
|
||||
return this.saveProfileAndCreateNotebook(profile);
|
||||
});
|
||||
this.apiWrapper.registerCommand(constants.jupyterNewNotebookCommand, (explorerContext: sqlops.ObjectExplorerContext) => {
|
||||
this.apiWrapper.registerCommand(constants.jupyterNewNotebookCommand, (explorerContext: azdata.ObjectExplorerContext) => {
|
||||
return this.saveProfileAndCreateNotebook(explorerContext ? explorerContext.connectionProfile : undefined);
|
||||
});
|
||||
this.apiWrapper.registerCommand(constants.jupyterAnalyzeCommand, (explorerContext: sqlops.ObjectExplorerContext) => {
|
||||
this.apiWrapper.registerCommand(constants.jupyterAnalyzeCommand, (explorerContext: azdata.ObjectExplorerContext) => {
|
||||
return this.saveProfileAndAnalyzeNotebook(explorerContext);
|
||||
});
|
||||
|
||||
@@ -113,15 +113,15 @@ export class JupyterController implements vscode.Disposable {
|
||||
extensionContext: this.extensionContext,
|
||||
apiWrapper: this.apiWrapper
|
||||
}));
|
||||
sqlops.nb.registerNotebookProvider(notebookProvider);
|
||||
azdata.nb.registerNotebookProvider(notebookProvider);
|
||||
return notebookProvider;
|
||||
}
|
||||
|
||||
private saveProfileAndCreateNotebook(profile: sqlops.IConnectionProfile): Promise<void> {
|
||||
private saveProfileAndCreateNotebook(profile: azdata.IConnectionProfile): Promise<void> {
|
||||
return this.handleNewNotebookTask(undefined, profile);
|
||||
}
|
||||
|
||||
private saveProfileAndAnalyzeNotebook(oeContext: sqlops.ObjectExplorerContext): Promise<void> {
|
||||
private saveProfileAndAnalyzeNotebook(oeContext: azdata.ObjectExplorerContext): Promise<void> {
|
||||
return this.handleNewNotebookTask(oeContext, oeContext.connectionProfile);
|
||||
}
|
||||
|
||||
@@ -131,11 +131,11 @@ export class JupyterController implements vscode.Disposable {
|
||||
}
|
||||
|
||||
// EVENT HANDLERS //////////////////////////////////////////////////////
|
||||
public async getDefaultConnection(): Promise<sqlops.ConnectionInfo> {
|
||||
public async getDefaultConnection(): Promise<azdata.connection.ConnectionProfile> {
|
||||
return await this.apiWrapper.getCurrentConnection();
|
||||
}
|
||||
|
||||
private async handleOpenNotebookTask(profile: sqlops.IConnectionProfile): Promise<void> {
|
||||
private async handleOpenNotebookTask(profile: azdata.IConnectionProfile): Promise<void> {
|
||||
let notebookFileTypeName = localize('notebookFileType', 'Notebooks');
|
||||
let filter = {};
|
||||
filter[notebookFileTypeName] = 'ipynb';
|
||||
@@ -151,7 +151,7 @@ export class JupyterController implements vscode.Disposable {
|
||||
// in the future might want additional supported types
|
||||
this.apiWrapper.showErrorMessage(localize('unsupportedFileType', 'Only .ipynb Notebooks are supported'));
|
||||
} else {
|
||||
await sqlops.nb.showNotebookDocument(fileUri, {
|
||||
await azdata.nb.showNotebookDocument(fileUri, {
|
||||
connectionId: profile.id,
|
||||
providerId: constants.jupyterNotebookProviderId,
|
||||
preview: false
|
||||
@@ -160,11 +160,11 @@ export class JupyterController implements vscode.Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
private async handleNewNotebookTask(oeContext?: sqlops.ObjectExplorerContext, profile?: sqlops.IConnectionProfile): Promise<void> {
|
||||
private async handleNewNotebookTask(oeContext?: azdata.ObjectExplorerContext, profile?: azdata.IConnectionProfile): Promise<void> {
|
||||
// Ensure we get a unique ID for the notebook. For now we're using a different prefix to the built-in untitled files
|
||||
// to handle this. We should look into improving this in the future
|
||||
let untitledUri = vscode.Uri.parse(`untitled:Notebook-${untitledCounter++}`);
|
||||
let editor = await sqlops.nb.showNotebookDocument(untitledUri, {
|
||||
let editor = await azdata.nb.showNotebookDocument(untitledUri, {
|
||||
connectionId: profile.id,
|
||||
providerId: constants.jupyterNotebookProviderId,
|
||||
preview: false,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { nb } from 'sqlops';
|
||||
import { nb } from 'azdata';
|
||||
import { Kernel, KernelMessage } from '@jupyterlab/services';
|
||||
|
||||
function toShellMessage(msgImpl: KernelMessage.IShellMessage): nb.IShellMessage {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { nb } from 'sqlops';
|
||||
import { nb } from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { ServerConnection, SessionManager } from '@jupyterlab/services';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { nb } from 'sqlops';
|
||||
import { nb } from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { ExecOptions } from 'child_process';
|
||||
import * as decompress from 'decompress';
|
||||
import * as request from 'request';
|
||||
@@ -82,25 +82,25 @@ export default class JupyterServerInstallation {
|
||||
return installation;
|
||||
}
|
||||
|
||||
private async installDependencies(backgroundOperation: sqlops.BackgroundOperation): Promise<void> {
|
||||
private async installDependencies(backgroundOperation: azdata.BackgroundOperation): Promise<void> {
|
||||
if (!fs.existsSync(this._pythonExecutable) || this._forceInstall) {
|
||||
window.showInformationMessage(msgInstallPkgStart);
|
||||
this.outputChannel.show(true);
|
||||
this.outputChannel.appendLine(msgPythonInstallationProgress);
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.InProgress, msgPythonInstallationProgress);
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonInstallationProgress);
|
||||
await this.installPythonPackage(backgroundOperation);
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.InProgress, msgPythonInstallationComplete);
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonInstallationComplete);
|
||||
this.outputChannel.appendLine(msgPythonInstallationComplete);
|
||||
|
||||
// Install jupyter on Windows because local python is not bundled with jupyter unlike linux and MacOS.
|
||||
await this.installJupyterProsePackage();
|
||||
await this.installSparkMagic();
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.Succeeded, msgInstallPkgFinish);
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.Succeeded, msgInstallPkgFinish);
|
||||
window.showInformationMessage(msgInstallPkgFinish);
|
||||
}
|
||||
}
|
||||
|
||||
private installPythonPackage(backgroundOperation: sqlops.BackgroundOperation): Promise<void> {
|
||||
private installPythonPackage(backgroundOperation: azdata.BackgroundOperation): Promise<void> {
|
||||
let bundleVersion = constants.pythonBundleVersion;
|
||||
let pythonVersion = constants.pythonVersion;
|
||||
let packageName = 'python-#pythonversion-#platform-#bundleversion.#extension';
|
||||
@@ -129,10 +129,10 @@ export default class JupyterServerInstallation {
|
||||
let self = undefined;
|
||||
return new Promise((resolve, reject) => {
|
||||
self = this;
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.InProgress, msgDownloadPython(platformId, pythonDownloadUrl));
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgDownloadPython(platformId, pythonDownloadUrl));
|
||||
fs.mkdirs(this._pythonInstallationPath, (err) => {
|
||||
if (err) {
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.InProgress, msgPythonDirectoryError);
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonDirectoryError);
|
||||
reject(err);
|
||||
}
|
||||
|
||||
@@ -141,12 +141,12 @@ export default class JupyterServerInstallation {
|
||||
let printThreshold = 0.1;
|
||||
request.get(pythonDownloadUrl, { timeout: 20000 })
|
||||
.on('error', (downloadError) => {
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.InProgress, msgPythonDownloadError);
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonDownloadError);
|
||||
reject(downloadError);
|
||||
})
|
||||
.on('response', (response) => {
|
||||
if (response.statusCode !== 200) {
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.InProgress, msgPythonDownloadError);
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonDownloadError);
|
||||
reject(response.statusMessage);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ export default class JupyterServerInstallation {
|
||||
try {
|
||||
fs.removeSync(pythonSourcePath);
|
||||
} catch (err) {
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.InProgress, msgPythonUnpackError);
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonUnpackError);
|
||||
reject(err);
|
||||
}
|
||||
}
|
||||
@@ -182,19 +182,19 @@ export default class JupyterServerInstallation {
|
||||
//Delete zip/tar file
|
||||
fs.unlink(pythonPackagePathLocal, (err) => {
|
||||
if (err) {
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.InProgress, msgPythonUnpackError);
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonUnpackError);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
|
||||
resolve();
|
||||
}).catch(err => {
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.InProgress, msgPythonUnpackError);
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonUnpackError);
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
.on('error', (downloadError) => {
|
||||
backgroundOperation.updateStatus(sqlops.TaskStatus.InProgress, msgPythonDownloadError);
|
||||
backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgPythonDownloadError);
|
||||
reject(downloadError);
|
||||
});
|
||||
});
|
||||
@@ -254,7 +254,7 @@ export default class JupyterServerInstallation {
|
||||
})
|
||||
.catch(err => {
|
||||
let errorMsg = msgDependenciesInstallationFailed(err);
|
||||
op.updateStatus(sqlops.TaskStatus.Failed, errorMsg);
|
||||
op.updateStatus(azdata.TaskStatus.Failed, errorMsg);
|
||||
this.apiWrapper.showErrorMessage(errorMsg);
|
||||
this._installCompleteEmitter.fire(errorMsg);
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { nb } from 'sqlops';
|
||||
import { nb } from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as path from 'path';
|
||||
import { ServerConnection } from '@jupyterlab/services';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { nb, ServerInfo, connection, IConnectionProfile } from 'sqlops';
|
||||
import { nb, ServerInfo, connection, IConnectionProfile } from 'azdata';
|
||||
import { Session, Kernel } from '@jupyterlab/services';
|
||||
import * as fs from 'fs-extra';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { nb } from 'sqlops';
|
||||
import { nb } from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { Contents } from '@jupyterlab/services';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as should from 'should';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as path from 'path';
|
||||
import { ContentsManager, Contents } from '@jupyterlab/services';
|
||||
import { nb } from 'sqlops';
|
||||
import { nb } from 'azdata';
|
||||
import 'mocha';
|
||||
|
||||
import { INotebook, CellTypes } from '../../contracts/content';
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import * as should from 'should';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { nb } from 'sqlops';
|
||||
import { nb } from 'azdata';
|
||||
import { Kernel, KernelMessage } from '@jupyterlab/services';
|
||||
import 'mocha';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import * as should from 'should';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { nb } from 'sqlops';
|
||||
import { nb } from 'azdata';
|
||||
import { SessionManager, Session, Kernel } from '@jupyterlab/services';
|
||||
import 'mocha';
|
||||
|
||||
|
||||
4
extensions/notebook/src/typings/refs.d.ts
vendored
4
extensions/notebook/src/typings/refs.d.ts
vendored
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/// <reference path='../../../../src/sql/sqlops.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.proposed.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
/// <reference types='@types/node'/>
|
||||
|
||||
Reference in New Issue
Block a user