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:
Abbie Petchtes
2018-04-13 11:11:25 -07:00
committed by GitHub
parent 9a5f51bfbf
commit 13fb9fdfd2
9 changed files with 86 additions and 2 deletions

View File

@@ -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.
*/