run the whole thing instead of current statement (#6757)

* run the whole thing instead of current statement

* backward compact
This commit is contained in:
Alan Ren
2019-08-15 13:43:08 -07:00
committed by GitHub
parent d4d11aa260
commit 314bd0e212
5 changed files with 14 additions and 8 deletions

View File

@@ -67,13 +67,17 @@ export class MainThreadQueryEditor implements MainThreadQueryEditorShape {
});
}
public $runQuery(fileUri: string): void {
public $runQuery(fileUri: string, runCurrentQuery: boolean = true): void {
let filteredEditors = this._editorService.visibleControls.filter(editor => editor.input.getResource().toString() === fileUri);
if (filteredEditors && filteredEditors.length > 0) {
let editor = filteredEditors[0];
if (editor instanceof QueryEditor) {
let queryEditor: QueryEditor = editor;
queryEditor.runCurrentQuery();
if (runCurrentQuery) {
queryEditor.runCurrentQuery();
} else {
queryEditor.runQuery();
}
}
}
}

View File

@@ -44,8 +44,8 @@ export class ExtHostQueryEditor implements ExtHostQueryEditorShape {
return this._proxy.$connect(fileUri, connectionId);
}
public $runQuery(fileUri: string): void {
return this._proxy.$runQuery(fileUri);
public $runQuery(fileUri: string, runCurrentQuery: boolean = true): void {
return this._proxy.$runQuery(fileUri, runCurrentQuery);
}
public $registerQueryInfoListener(providerId: string, listener: azdata.queryeditor.QueryEventListener): void {

View File

@@ -834,8 +834,8 @@ export function createAzdataApiFactory(accessor: ServicesAccessor): IAzdataExten
return extHostQueryEditor.$connect(fileUri, connectionId);
},
runQuery(fileUri: string, options?: Map<string, string>): void {
extHostQueryEditor.$runQuery(fileUri);
runQuery(fileUri: string, options?: Map<string, string>, runCurrentQuery: boolean = true): void {
extHostQueryEditor.$runQuery(fileUri, runCurrentQuery);
},
registerQueryEventListener(listener: azdata.queryeditor.QueryEventListener): void {

View File

@@ -813,7 +813,7 @@ export interface ExtHostQueryEditorShape {
export interface MainThreadQueryEditorShape extends IDisposable {
$connect(fileUri: string, connectionId: string): Thenable<void>;
$runQuery(fileUri: string): void;
$runQuery(fileUri: string, runCurrentQuery?: boolean): void;
$createQueryTab(fileUri: string, title: string, content: string): void;
$setQueryExecutionOptions(fileUri: string, options: azdata.QueryExecutionOptions): Thenable<void>;
$registerQueryInfoListener(handle: number, providerId: string): void;