mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 01:25:36 -05:00
run the whole thing instead of current statement (#6757)
* run the whole thing instead of current statement * backward compact
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user