mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
Merge from vscode 8df646d3c5477b02737fc10343fa7cf0cc3f606b
This commit is contained in:
@@ -4,32 +4,16 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Editors } from '../editors';
|
||||
import { QuickOpen } from '../quickopen';
|
||||
import { Code } from '../code';
|
||||
import * as path from 'path';
|
||||
|
||||
export class QueryEditors extends Editors {
|
||||
|
||||
constructor(
|
||||
private vsCode: Code,
|
||||
private quickopen: QuickOpen
|
||||
private vsCode: Code
|
||||
) {
|
||||
super(vsCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the specified file - this correctly handles SQL files which are opened in a Query Editor window
|
||||
* @param filePath The full path of the file to open.
|
||||
*/
|
||||
async openFile(filePath: string): Promise<void> {
|
||||
await this.quickopen.openQuickOpen(filePath);
|
||||
|
||||
const fileBaseName = path.basename(filePath);
|
||||
await this.quickopen.waitForQuickOpenElements(names => names[0] === fileBaseName);
|
||||
await this.vsCode.dispatchKeybinding('enter');
|
||||
await this.waitForEditorFocus(fileBaseName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits for an active SQL Query Editor tab for the specified file. This is a modification of the editors.waitForActiveTab that
|
||||
* takes into account the connected status displayed in the title of Query Editors.
|
||||
@@ -41,7 +25,6 @@ export class QueryEditors extends Editors {
|
||||
await this.vsCode.waitForElement(`.tabs-container div.tab.active${isDirty ? '.dirty' : ''}[aria-selected="true"][aria-label="${fileName} - disconnected, tab"]`);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Waits for an active Query Editor for the specified file to have focus. This is a modification of the editors.waitForEditorFocus
|
||||
* that takes into account the connected status displayed in the title of Query Editors.
|
||||
|
||||
Reference in New Issue
Block a user