mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Merge from vscode 1ec43773e37997841c5af42b33ddb180e9735bf2
This commit is contained in:
@@ -153,7 +153,7 @@ export class Application {
|
||||
}
|
||||
|
||||
// wait a bit, since focus might be stolen off widgets
|
||||
// as soon as they open (e.g. quick open)
|
||||
// as soon as they open (e.g. quick access)
|
||||
await new Promise(c => setTimeout(c, 1000));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
|
||||
options.workspacePath,
|
||||
'--skip-getting-started',
|
||||
'--skip-release-notes',
|
||||
'--sticky-quickopen',
|
||||
'--sticky-quickinput',
|
||||
'--disable-telemetry',
|
||||
'--disable-updates',
|
||||
'--disable-crash-reporter',
|
||||
|
||||
@@ -16,7 +16,7 @@ export * from './logger';
|
||||
export * from './peek';
|
||||
export * from './problems';
|
||||
export * from './quickinput';
|
||||
export * from './quickopen';
|
||||
export * from './quickaccess';
|
||||
export * from './scm';
|
||||
export * from './search';
|
||||
export * from './settings';
|
||||
|
||||
@@ -7,14 +7,14 @@ import { Editors } from './editors';
|
||||
import { Code } from './code';
|
||||
import { QuickInput } from './quickinput';
|
||||
|
||||
export class QuickOpen {
|
||||
export class QuickAccess {
|
||||
|
||||
constructor(private code: Code, private editors: Editors, private quickInput: QuickInput) { }
|
||||
|
||||
async openQuickOpen(value: string): Promise<void> {
|
||||
async openQuickAccess(value: string): Promise<void> {
|
||||
let retries = 0;
|
||||
|
||||
// other parts of code might steal focus away from quickopen :(
|
||||
// other parts of code might steal focus away from quickinput :(
|
||||
while (retries < 5) {
|
||||
if (process.platform === 'darwin') {
|
||||
await this.code.dispatchKeybinding('cmd+p');
|
||||
@@ -40,7 +40,7 @@ export class QuickOpen {
|
||||
}
|
||||
|
||||
async openFile(fileName: string): Promise<void> {
|
||||
await this.openQuickOpen(fileName);
|
||||
await this.openQuickAccess(fileName);
|
||||
|
||||
await this.quickInput.waitForQuickInputElements(names => names[0] === fileName);
|
||||
await this.code.dispatchKeybinding('enter');
|
||||
@@ -49,7 +49,7 @@ export class QuickOpen {
|
||||
}
|
||||
|
||||
async runCommand(commandId: string): Promise<void> {
|
||||
await this.openQuickOpen(`>${commandId}`);
|
||||
await this.openQuickAccess(`>${commandId}`);
|
||||
|
||||
// wait for best choice to be focused
|
||||
await this.code.waitForTextContent(QuickInput.QUICK_INPUT_FOCUSED_ELEMENT);
|
||||
@@ -8,11 +8,11 @@ import * as path from 'path';
|
||||
import { Editor } from './editor';
|
||||
import { Editors } from './editors';
|
||||
import { Code } from './code';
|
||||
import { QuickOpen } from './quickopen';
|
||||
import { QuickAccess } from './quickaccess';
|
||||
|
||||
export class SettingsEditor {
|
||||
|
||||
constructor(private code: Code, private userDataPath: string, private editors: Editors, private editor: Editor, private quickopen: QuickOpen) { }
|
||||
constructor(private code: Code, private userDataPath: string, private editors: Editors, private editor: Editor, private quickaccess: QuickAccess) { }
|
||||
|
||||
async addUserSetting(setting: string, value: string): Promise<void> {
|
||||
await this.openSettings();
|
||||
@@ -32,6 +32,6 @@ export class SettingsEditor {
|
||||
}
|
||||
|
||||
private async openSettings(): Promise<void> {
|
||||
await this.quickopen.runCommand('workbench.action.openSettingsJson');
|
||||
await this.quickaccess.runCommand('workbench.action.openSettingsJson');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Code } from '../code';
|
||||
import { QuickOpen } from '../quickopen';
|
||||
import { QuickAccess } from '../quickaccess';
|
||||
import { waitForNewDialog, clickDialogButton } from './sqlutils';
|
||||
|
||||
const NEW_SESSION_DIALOG_TITLE: string = 'Start New Profiler Session';
|
||||
|
||||
export class Profiler {
|
||||
|
||||
constructor(private code: Code, private quickopen: QuickOpen) { }
|
||||
constructor(private code: Code, private quickopen: QuickAccess) { }
|
||||
|
||||
async launchProfiler(): Promise<void> {
|
||||
await this.quickopen.runCommand('Profiler: Launch Profiler');
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Code } from './code';
|
||||
import { QuickOpen } from './quickopen';
|
||||
import { QuickAccess } from './quickaccess';
|
||||
|
||||
const PANEL_SELECTOR = 'div[id="workbench.panel.terminal"]';
|
||||
const XTERM_SELECTOR = `${PANEL_SELECTOR} .terminal-wrapper`;
|
||||
@@ -12,10 +12,10 @@ const XTERM_TEXTAREA = `${XTERM_SELECTOR} textarea.xterm-helper-textarea`;
|
||||
|
||||
export class Terminal {
|
||||
|
||||
constructor(private code: Code, private quickopen: QuickOpen) { }
|
||||
constructor(private code: Code, private quickaccess: QuickAccess) { }
|
||||
|
||||
async showTerminal(): Promise<void> {
|
||||
await this.quickopen.runCommand('workbench.action.terminal.toggleTerminal');
|
||||
await this.quickaccess.runCommand('workbench.action.terminal.toggleTerminal');
|
||||
await this.code.waitForActiveElement(XTERM_TEXTAREA);
|
||||
await this.code.waitForTerminalBuffer(XTERM_SELECTOR, lines => lines.some(line => line.length > 0));
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { Explorer } from './explorer';
|
||||
import { ActivityBar } from './activityBar';
|
||||
import { QuickOpen } from './quickopen';
|
||||
import { QuickAccess } from './quickaccess';
|
||||
import { QuickInput } from './quickinput';
|
||||
import { Extensions } from './extensions';
|
||||
import { Search } from './search';
|
||||
@@ -32,7 +32,7 @@ export interface Commands {
|
||||
|
||||
export class Workbench {
|
||||
|
||||
readonly quickopen: QuickOpen;
|
||||
readonly quickaccess: QuickAccess;
|
||||
readonly quickinput: QuickInput;
|
||||
readonly editors: Editors;
|
||||
readonly explorer: Explorer;
|
||||
@@ -57,22 +57,22 @@ export class Workbench {
|
||||
constructor(code: Code, userDataPath: string) {
|
||||
this.editors = new Editors(code);
|
||||
this.quickinput = new QuickInput(code);
|
||||
this.quickopen = new QuickOpen(code, this.editors, this.quickinput);
|
||||
this.quickaccess = new QuickAccess(code, this.editors, this.quickinput);
|
||||
this.explorer = new Explorer(code, this.editors);
|
||||
this.activitybar = new ActivityBar(code);
|
||||
this.search = new Search(code);
|
||||
this.extensions = new Extensions(code);
|
||||
this.editor = new Editor(code, this.quickopen);
|
||||
this.editor = new Editor(code, this.quickaccess);
|
||||
this.scm = new SCM(code);
|
||||
this.debug = new Debug(code, this.quickopen, this.editors, this.editor);
|
||||
this.debug = new Debug(code, this.quickaccess, this.editors, this.editor);
|
||||
this.statusbar = new StatusBar(code);
|
||||
this.problems = new Problems(code);
|
||||
this.settingsEditor = new SettingsEditor(code, userDataPath, this.editors, this.editor, this.quickopen);
|
||||
this.settingsEditor = new SettingsEditor(code, userDataPath, this.editors, this.editor, this.quickaccess);
|
||||
this.keybindingsEditor = new KeybindingsEditor(code);
|
||||
this.terminal = new Terminal(code, this.quickopen);
|
||||
this.terminal = new Terminal(code, this.quickaccess);
|
||||
// {{SQL CARBON EDIT}}
|
||||
this.connectionDialog = new ConnectionDialog(code);
|
||||
this.profiler = new Profiler(code, this.quickopen);
|
||||
this.profiler = new Profiler(code, this.quickaccess);
|
||||
this.queryEditors = new QueryEditors(code);
|
||||
// {{END}}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user