mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 09:35:37 -05:00
Add keyboard shortcuts for focus on current query and go to next output query tab (#1153)
* add go to next output query tab shotcut * add a new keyboard shortcut for focus on current query * minor change
This commit is contained in:
@@ -51,6 +51,34 @@ function escapeSqlString(input: string, escapeChar: string) {
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Locates the active editor and call focus() on the editor if it is a QueryEditor.
|
||||
*/
|
||||
export class FocusOnCurrentQueryKeyboardAction extends Action {
|
||||
|
||||
public static ID = 'focusOnCurrentQueryKeyboardAction';
|
||||
public static LABEL = nls.localize('focusOnCurrentQueryKeyboardAction', 'Focus on Current Query');
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IWorkbenchEditorService private _editorService: IWorkbenchEditorService
|
||||
) {
|
||||
super(id, label);
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): TPromise<void> {
|
||||
let editor = this._editorService.getActiveEditor();
|
||||
if (editor && editor instanceof QueryEditor) {
|
||||
let queryEditor: QueryEditor = editor;
|
||||
queryEditor.focus();
|
||||
}
|
||||
return TPromise.as(null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Locates the active editor and calls runQuery() on the editor if it is a QueryEditor.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user