diff --git a/src/sql/platform/connection/test/common/connectionStore.test.ts b/src/sql/platform/connection/test/common/connectionStore.test.ts index 318ff1264a..8b9cfe1e45 100644 --- a/src/sql/platform/connection/test/common/connectionStore.test.ts +++ b/src/sql/platform/connection/test/common/connectionStore.test.ts @@ -477,7 +477,7 @@ suite('ConnectionStore', () => { for (let i = 0; i < 5; i++) { const cred = Object.assign({}, defaultNamedProfile, { serverName: defaultNamedProfile.serverName + i }); const connectionProfile = new ConnectionProfile(capabilitiesService, cred); - await connectionStore.removeRecentConnection(connectionProfile); + connectionStore.removeRecentConnection(connectionProfile); const current = connectionStore.getRecentlyUsedConnections(); assert.equal(current.length, 4 - i); } diff --git a/src/sql/workbench/parts/commandLine/electron-browser/commandLine.ts b/src/sql/workbench/parts/commandLine/electron-browser/commandLine.ts index 9226aa1aa8..f5d9b1061f 100644 --- a/src/sql/workbench/parts/commandLine/electron-browser/commandLine.ts +++ b/src/sql/workbench/parts/commandLine/electron-browser/commandLine.ts @@ -134,7 +134,7 @@ export class CommandLineWorkbenchContribution implements IWorkbenchContribution, // we want to connect the given profile to to it. // If more than one file was passed, only show the connection dialog error on one of them. if (args._ && args._.length > 0) { - await args._.forEach((f, i) => this.processFile(URI.file(f).toString(), profile, i === 0)); + await Promise.all(args._.map((f, i) => this.processFile(URI.file(f).toString(), profile, i === 0))); } else { // Default to showing new query diff --git a/src/sql/workbench/parts/notebook/browser/models/cell.ts b/src/sql/workbench/parts/notebook/browser/models/cell.ts index 4d9a0d5a6c..44e9781e97 100644 --- a/src/sql/workbench/parts/notebook/browser/models/cell.ts +++ b/src/sql/workbench/parts/notebook/browser/models/cell.ts @@ -329,7 +329,7 @@ export class CellModel implements ICellModel { if ((Array.isArray(content) && content.length > 0) || (!Array.isArray(content) && content)) { // requestExecute expects a string for the code parameter content = Array.isArray(content) ? content.join('') : content; - let future = await kernel.requestExecute({ + const future = kernel.requestExecute({ code: content, stop_on_error: true }, false); diff --git a/src/sql/workbench/parts/notebook/browser/models/notebookContexts.ts b/src/sql/workbench/parts/notebook/browser/models/notebookContexts.ts index b33414110b..4e9f32e0f5 100644 --- a/src/sql/workbench/parts/notebook/browser/models/notebookContexts.ts +++ b/src/sql/workbench/parts/notebook/browser/models/notebookContexts.ts @@ -49,7 +49,7 @@ export class NotebookContexts { * @param kernelChangedArgs kernel changed args (both old and new kernel info) * @param profile current connection profile */ - public static async getContextsForKernel(connectionService: IConnectionManagementService, connProviderIds: string[], kernelChangedArgs?: nb.IKernelChangedArgs, profile?: IConnectionProfile): Promise { + public static getContextsForKernel(connectionService: IConnectionManagementService, connProviderIds: string[], kernelChangedArgs?: nb.IKernelChangedArgs, profile?: IConnectionProfile): IDefaultConnection { let connections: IDefaultConnection = this.DefaultContext; if (!profile) { if (!kernelChangedArgs || !kernelChangedArgs.newValue || @@ -61,7 +61,7 @@ export class NotebookContexts { if (kernelChangedArgs && kernelChangedArgs.newValue && kernelChangedArgs.newValue.name && connProviderIds.length < 1) { return connections; } else { - connections = await this.getActiveContexts(connectionService, connProviderIds, profile); + connections = this.getActiveContexts(connectionService, connProviderIds, profile); } return connections; } @@ -71,9 +71,9 @@ export class NotebookContexts { * @param apiWrapper ApiWrapper * @param profile current connection profile */ - public static async getActiveContexts(connectionService: IConnectionManagementService, connProviderIds: string[], profile: IConnectionProfile): Promise { + public static getActiveContexts(connectionService: IConnectionManagementService, connProviderIds: string[], profile: IConnectionProfile): IDefaultConnection { let defaultConnection: ConnectionProfile = NotebookContexts.DefaultContext.defaultConnection; - let activeConnections: ConnectionProfile[] = await connectionService.getActiveConnections(); + let activeConnections: ConnectionProfile[] = connectionService.getActiveConnections(); if (activeConnections && activeConnections.length > 0) { activeConnections = activeConnections.filter(conn => conn.id !== '-1'); } diff --git a/src/sql/workbench/parts/notebook/browser/models/notebookModel.ts b/src/sql/workbench/parts/notebook/browser/models/notebookModel.ts index cda7519a53..37d33a168d 100644 --- a/src/sql/workbench/parts/notebook/browser/models/notebookModel.ts +++ b/src/sql/workbench/parts/notebook/browser/models/notebookModel.ts @@ -840,7 +840,7 @@ export class NotebookModel extends Disposable implements INotebookModel { private async loadActiveContexts(kernelChangedArgs: nb.IKernelChangedArgs): Promise { if (kernelChangedArgs && kernelChangedArgs.newValue && kernelChangedArgs.newValue.name) { let kernelDisplayName = this.getDisplayNameFromSpecName(kernelChangedArgs.newValue); - this._activeContexts = await NotebookContexts.getContextsForKernel(this._notebookOptions.connectionService, this.getApplicableConnectionProviderIds(kernelDisplayName), kernelChangedArgs, this.connectionProfile); + this._activeContexts = NotebookContexts.getContextsForKernel(this._notebookOptions.connectionService, this.getApplicableConnectionProviderIds(kernelDisplayName), kernelChangedArgs, this.connectionProfile); this._contextsChangedEmitter.fire(); if (this.contexts.defaultConnection !== undefined && this.contexts.defaultConnection.serverName !== undefined && this.contexts.defaultConnection.title !== undefined) { await this.changeContext(this.contexts.defaultConnection.title, this.contexts.defaultConnection); diff --git a/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts b/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts index 585cc4f11f..46d8813039 100644 --- a/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts +++ b/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts @@ -455,7 +455,7 @@ export class NotebookService extends Disposable implements INotebookService { if (!providerDescriptor.instance) { // Await extension registration before awaiting provider registration try { - await this._extensionService.whenInstalledExtensionsRegistered; + await this._extensionService.whenInstalledExtensionsRegistered(); } catch (error) { console.error(error); } diff --git a/tslint-sql.json b/tslint-sql.json index d5c2296fb1..2e797a7a76 100644 --- a/tslint-sql.json +++ b/tslint-sql.json @@ -17,9 +17,10 @@ "severity": "warn" }, "await-promise": { - "severity": "warn", "options": [ - "Thenable" + "Thenable", + "Deferred", + "PromiseLike" ] }, "use-isnan": {