diff --git a/src/sql/workbench/api/browser/mainThreadQueryEditor.ts b/src/sql/workbench/api/browser/mainThreadQueryEditor.ts index 8a6ef7e1fb..2e5859a719 100644 --- a/src/sql/workbench/api/browser/mainThreadQueryEditor.ts +++ b/src/sql/workbench/api/browser/mainThreadQueryEditor.ts @@ -111,9 +111,10 @@ export class MainThreadQueryEditor extends Disposable implements MainThreadQuery } } - public $registerQueryInfoListener(handle: number, providerId: string): void { + public $registerQueryInfoListener(handle: number): void { this._register(this._queryModelService.onQueryEvent(event => { - this._proxy.$onQueryEvent(handle, event.uri, event); + let connectionProfile = this._connectionManagementService.getConnectionProfile(event.uri); + this._proxy.$onQueryEvent(connectionProfile?.providerName, handle, event.uri, event); })); } diff --git a/src/sql/workbench/api/common/extHostQueryEditor.ts b/src/sql/workbench/api/common/extHostQueryEditor.ts index e3be3e9d6b..4cb0347d6d 100644 --- a/src/sql/workbench/api/common/extHostQueryEditor.ts +++ b/src/sql/workbench/api/common/extHostQueryEditor.ts @@ -52,17 +52,17 @@ export class ExtHostQueryEditor implements ExtHostQueryEditorShape { return this._proxy.$runQuery(fileUri, runCurrentQuery); } - public $registerQueryInfoListener(providerId: string, listener: azdata.queryeditor.QueryEventListener): void { + public $registerQueryInfoListener(listener: azdata.queryeditor.QueryEventListener): void { this._queryListeners[this._nextListenerHandle] = listener; - this._proxy.$registerQueryInfoListener(this._nextListenerHandle, providerId); + this._proxy.$registerQueryInfoListener(this._nextListenerHandle); this._nextListenerHandle++; } - public $onQueryEvent(handle: number, fileUri: string, event: IQueryEvent): void { + public $onQueryEvent(providerId: string, handle: number, fileUri: string, event: IQueryEvent): void { let listener: azdata.queryeditor.QueryEventListener = this._queryListeners[handle]; if (listener) { let params = event.params && event.params.planXml ? event.params.planXml : event.params; - listener.onQueryEvent(event.type, new ExtHostQueryDocument(mssqlProviderName, fileUri, this._proxy), params); + listener.onQueryEvent(event.type, new ExtHostQueryDocument(providerId, fileUri, this._proxy), params); } } diff --git a/src/sql/workbench/api/common/sqlExtHost.api.impl.ts b/src/sql/workbench/api/common/sqlExtHost.api.impl.ts index 2d0059e9be..f2e5f95b9b 100644 --- a/src/sql/workbench/api/common/sqlExtHost.api.impl.ts +++ b/src/sql/workbench/api/common/sqlExtHost.api.impl.ts @@ -486,7 +486,7 @@ export function createAdsApiFactory(accessor: ServicesAccessor): IAdsExtensionAp }, registerQueryEventListener(listener: azdata.queryeditor.QueryEventListener): void { - extHostQueryEditor.$registerQueryInfoListener(mssqlProviderName, listener); + extHostQueryEditor.$registerQueryInfoListener(listener); }, getQueryDocument(fileUri: string): Thenable { diff --git a/src/sql/workbench/api/common/sqlExtHost.protocol.ts b/src/sql/workbench/api/common/sqlExtHost.protocol.ts index 8fa8e63875..b185e3e486 100644 --- a/src/sql/workbench/api/common/sqlExtHost.protocol.ts +++ b/src/sql/workbench/api/common/sqlExtHost.protocol.ts @@ -820,7 +820,7 @@ export interface MainThreadModelViewDialogShape extends IDisposable { $setDirty(handle: number, isDirty: boolean): void; } export interface ExtHostQueryEditorShape { - $onQueryEvent(handle: number, fileUri: string, event: IQueryEvent): void; + $onQueryEvent(providerId: string, handle: number, fileUri: string, event: IQueryEvent): void; } export interface MainThreadQueryEditorShape extends IDisposable { @@ -829,7 +829,7 @@ export interface MainThreadQueryEditorShape extends IDisposable { $runQuery(fileUri: string, runCurrentQuery?: boolean): void; $createQueryTab(fileUri: string, title: string, content: string): void; $setQueryExecutionOptions(fileUri: string, options: azdata.QueryExecutionOptions): Thenable; - $registerQueryInfoListener(handle: number, providerId: string): void; + $registerQueryInfoListener(handle: number): void; } export interface ExtHostNotebookShape {