Fix some unhandled promise lint errors (#16924)

This commit is contained in:
Charles Gagnon
2021-08-30 09:08:28 -07:00
committed by GitHub
parent fde114bb14
commit 7804c87c87
14 changed files with 48 additions and 48 deletions

View File

@@ -123,7 +123,7 @@ export class JupyterController {
// Verify this is a .ipynb file since this isn't actually filtered on Mac/Linux
if (path.extname(fileUri.fsPath) !== '.ipynb') {
// in the future might want additional supported types
vscode.window.showErrorMessage(localize('unsupportedFileType', "Only .ipynb Notebooks are supported"));
void vscode.window.showErrorMessage(localize('unsupportedFileType', "Only .ipynb Notebooks are supported"));
} else {
await azdata.nb.showNotebookDocument(fileUri, {
connectionProfile: profile,
@@ -174,7 +174,7 @@ export class JupyterController {
await this._jupyterInstallation.startInstallProcess(true);
}
} catch (err) {
vscode.window.showErrorMessage(utils.getErrorMessage(err));
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
}
}
@@ -202,7 +202,7 @@ export class JupyterController {
packagesDialog.showDialog();
} catch (error) {
let message = utils.getErrorMessage(error);
vscode.window.showErrorMessage(message);
void vscode.window.showErrorMessage(message);
}
}
@@ -236,10 +236,10 @@ export class JupyterController {
public doConfigurePython(jupyterInstaller: JupyterServerInstallation): void {
let pythonWizard = new ConfigurePythonWizard(jupyterInstaller);
pythonWizard.start().catch((err: any) => {
vscode.window.showErrorMessage(utils.getErrorMessage(err));
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
});
pythonWizard.setupComplete.catch((err: any) => {
vscode.window.showErrorMessage(utils.getErrorMessage(err));
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
});
}

View File

@@ -44,7 +44,7 @@ export class JupyterNotebookManager implements nb.NotebookManager, vscode.Dispos
dispose() {
if (this._sessionManager) {
this._sessionManager.shutdownAll().then(() => this._sessionManager.dispose());
void this._sessionManager.shutdownAll().then(() => this._sessionManager.dispose());
}
if (this._serverManager) {
this._serverManager.stopServer().then(success => undefined, error => vscode.window.showErrorMessage(error));

View File

@@ -139,7 +139,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
this.outputChannel = outputChannel;
this._runningOnSAW = vscode.env.appName.toLowerCase().indexOf('saw') > 0;
vscode.commands.executeCommand(constants.BuiltInCommands.SetContext, 'notebook:runningOnSAW', this._runningOnSAW);
void vscode.commands.executeCommand(constants.BuiltInCommands.SetContext, 'notebook:runningOnSAW', this._runningOnSAW);
if (this._runningOnSAW) {
this._pythonInstallationPath = `${vscode.env.appRoot}\\ads-python`;
@@ -170,7 +170,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
}
private async installDependencies(backgroundOperation: azdata.BackgroundOperation, forceInstall: boolean, packages: PythonPkgDetails[]): Promise<void> {
vscode.window.showInformationMessage(msgInstallPkgStart);
void vscode.window.showInformationMessage(msgInstallPkgStart);
this.outputChannel.show(true);
this.outputChannel.appendLine(msgInstallPkgProgress);
@@ -224,7 +224,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
this.outputChannel.appendLine(msgInstallPkgFinish);
backgroundOperation.updateStatus(azdata.TaskStatus.Succeeded, msgInstallPkgFinish);
vscode.window.showInformationMessage(msgInstallPkgFinish);
void vscode.window.showInformationMessage(msgInstallPkgFinish);
}
private installPythonPackage(backgroundOperation: azdata.BackgroundOperation, usingExistingPython: boolean, pythonInstallationPath: string, outputChannel: vscode.OutputChannel): Promise<void> {
@@ -438,7 +438,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
}
if (this._installInProgress) {
vscode.window.showInformationMessage(msgWaitingForInstall);
void vscode.window.showInformationMessage(msgWaitingForInstall);
return this._installCompletion.promise;
}
@@ -500,7 +500,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
return Promise.resolve();
}
if (this._installInProgress) {
vscode.window.showInformationMessage(msgWaitingForInstall);
void vscode.window.showInformationMessage(msgWaitingForInstall);
return this._installCompletion.promise;
}
@@ -532,7 +532,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
if (response === yes) {
this._oldPythonInstallationPath = path.join(this._pythonInstallationPath, '0.0.1');
this._oldPythonExecutable = this._pythonExecutable;
vscode.commands.executeCommand(constants.jupyterConfigurePython);
void vscode.commands.executeCommand(constants.jupyterConfigurePython);
} else if (response === dontAskAgain) {
await notebookConfig.update(constants.dontPromptPythonUpdate, true, vscode.ConfigurationTarget.Global);
}

View File

@@ -70,7 +70,7 @@ export class LocalJupyterServerManager implements nb.ServerManager, vscode.Dispo
public dispose(): void {
this.stopServer().catch(err => {
let msg = utils.getErrorMessage(err);
vscode.window.showErrorMessage(localize('shutdownError', "Shutdown of Notebook server failed: {0}", msg));
void vscode.window.showErrorMessage(localize('shutdownError', "Shutdown of Notebook server failed: {0}", msg));
});
}
@@ -105,7 +105,7 @@ export class LocalJupyterServerManager implements nb.ServerManager, vscode.Dispo
private async doStartServer(kernelSpec: nb.IKernelSpec): Promise<IServerInstance> { // We can't find or create servers until the installation is complete
let installation = this.options.jupyterInstallation;
await installation.promptForPythonInstall(kernelSpec.display_name);
vscode.commands.executeCommand(BuiltInCommands.SetContext, CommandContext.NotebookPythonInstalled, true);
void vscode.commands.executeCommand(BuiltInCommands.SetContext, CommandContext.NotebookPythonInstalled, true);
// Calculate the path to use as the notebook-dir for Jupyter based on the path of the uri of the
// notebook to open. This will be the workspace folder if the notebook uri is inside a workspace