diff --git a/src/sql/workbench/contrib/query/common/queryEditorInput.ts b/src/sql/workbench/contrib/query/common/queryEditorInput.ts index ffcd0dd530..44b4c2f8e2 100644 --- a/src/sql/workbench/contrib/query/common/queryEditorInput.ts +++ b/src/sql/workbench/contrib/query/common/queryEditorInput.ts @@ -133,6 +133,14 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab this._text.onDidChangeDirty(() => this._onDidChangeDirty.fire()); + this._register( + this.queryModelService.onRunQueryStart(uri => { + if (this.uri === uri) { + this.onRunQuery(); + } + }) + ); + this._register( this.queryModelService.onRunQueryComplete(uri => { if (this.uri === uri) { @@ -153,6 +161,8 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab } })); + this.connectionManagementService.ensureDefaultLanguageFlavor(this.uri); + this.onDisconnect(); this.onQueryComplete(); }