mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51: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:
4
src/sql/azdata.d.ts
vendored
4
src/sql/azdata.d.ts
vendored
@@ -4035,8 +4035,10 @@ declare module 'azdata' {
|
|||||||
/**
|
/**
|
||||||
* Run query if it is a query editor and it is already opened.
|
* Run query if it is a query editor and it is already opened.
|
||||||
* @param fileUri file URI for the query editor
|
* @param fileUri file URI for the query editor
|
||||||
|
* @param options options
|
||||||
|
* @param runCurrentQuery true: run current query only, false: run all the queries in the file, default is true.
|
||||||
*/
|
*/
|
||||||
export function runQuery(fileUri: string, options?: Map<string, string>): void;
|
export function runQuery(fileUri: string, options?: Map<string, string>, runCurrentQuery?: boolean): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a query event listener
|
* Register a query event listener
|
||||||
|
|||||||
@@ -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);
|
let filteredEditors = this._editorService.visibleControls.filter(editor => editor.input.getResource().toString() === fileUri);
|
||||||
if (filteredEditors && filteredEditors.length > 0) {
|
if (filteredEditors && filteredEditors.length > 0) {
|
||||||
let editor = filteredEditors[0];
|
let editor = filteredEditors[0];
|
||||||
if (editor instanceof QueryEditor) {
|
if (editor instanceof QueryEditor) {
|
||||||
let queryEditor: QueryEditor = editor;
|
let queryEditor: QueryEditor = editor;
|
||||||
|
if (runCurrentQuery) {
|
||||||
queryEditor.runCurrentQuery();
|
queryEditor.runCurrentQuery();
|
||||||
|
} else {
|
||||||
|
queryEditor.runQuery();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ export class ExtHostQueryEditor implements ExtHostQueryEditorShape {
|
|||||||
return this._proxy.$connect(fileUri, connectionId);
|
return this._proxy.$connect(fileUri, connectionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public $runQuery(fileUri: string): void {
|
public $runQuery(fileUri: string, runCurrentQuery: boolean = true): void {
|
||||||
return this._proxy.$runQuery(fileUri);
|
return this._proxy.$runQuery(fileUri, runCurrentQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
public $registerQueryInfoListener(providerId: string, listener: azdata.queryeditor.QueryEventListener): void {
|
public $registerQueryInfoListener(providerId: string, listener: azdata.queryeditor.QueryEventListener): void {
|
||||||
|
|||||||
@@ -834,8 +834,8 @@ export function createAzdataApiFactory(accessor: ServicesAccessor): IAzdataExten
|
|||||||
return extHostQueryEditor.$connect(fileUri, connectionId);
|
return extHostQueryEditor.$connect(fileUri, connectionId);
|
||||||
},
|
},
|
||||||
|
|
||||||
runQuery(fileUri: string, options?: Map<string, string>): void {
|
runQuery(fileUri: string, options?: Map<string, string>, runCurrentQuery: boolean = true): void {
|
||||||
extHostQueryEditor.$runQuery(fileUri);
|
extHostQueryEditor.$runQuery(fileUri, runCurrentQuery);
|
||||||
},
|
},
|
||||||
|
|
||||||
registerQueryEventListener(listener: azdata.queryeditor.QueryEventListener): void {
|
registerQueryEventListener(listener: azdata.queryeditor.QueryEventListener): void {
|
||||||
|
|||||||
@@ -813,7 +813,7 @@ export interface ExtHostQueryEditorShape {
|
|||||||
|
|
||||||
export interface MainThreadQueryEditorShape extends IDisposable {
|
export interface MainThreadQueryEditorShape extends IDisposable {
|
||||||
$connect(fileUri: string, connectionId: string): Thenable<void>;
|
$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;
|
$createQueryTab(fileUri: string, title: string, content: string): void;
|
||||||
$setQueryExecutionOptions(fileUri: string, options: azdata.QueryExecutionOptions): Thenable<void>;
|
$setQueryExecutionOptions(fileUri: string, options: azdata.QueryExecutionOptions): Thenable<void>;
|
||||||
$registerQueryInfoListener(handle: number, providerId: string): void;
|
$registerQueryInfoListener(handle: number, providerId: string): void;
|
||||||
|
|||||||
Reference in New Issue
Block a user