mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-08 17:24:01 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -13,9 +13,8 @@ import types = require('vs/base/common/types');
|
||||
import errors = require('vs/base/common/errors');
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { Mode, IEntryRunContext, IAutoFocus, IModel, IQuickNavigateConfiguration } from 'vs/base/parts/quickopen/common/quickOpen';
|
||||
import { QuickOpenEntry, IHighlight, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel';
|
||||
import { QuickOpenEntry, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel';
|
||||
import { EditorOptions, EditorInput } from 'vs/workbench/common/editor';
|
||||
import { IResourceInput, IEditorInput, IEditorOptions } from 'vs/platform/editor/common/editor';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -131,7 +130,6 @@ export class QuickOpenHandlerDescriptor {
|
||||
public prefix: string;
|
||||
public description: string;
|
||||
public contextKey: string;
|
||||
public isDefault: boolean;
|
||||
public helpEntries: QuickOpenHandlerHelpEntry[];
|
||||
public instantProgress: boolean;
|
||||
|
||||
@@ -268,28 +266,30 @@ export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuick
|
||||
const hideWidget = (mode === Mode.OPEN);
|
||||
|
||||
if (mode === Mode.OPEN || mode === Mode.OPEN_IN_BACKGROUND) {
|
||||
let sideBySide = context.keymods.indexOf(KeyMod.CtrlCmd) >= 0;
|
||||
const sideBySide = context.keymods.ctrlCmd;
|
||||
|
||||
let openInBackgroundOptions: IEditorOptions;
|
||||
let openOptions: IEditorOptions;
|
||||
if (mode === Mode.OPEN_IN_BACKGROUND) {
|
||||
openInBackgroundOptions = { pinned: true, preserveFocus: true };
|
||||
openOptions = { pinned: true, preserveFocus: true };
|
||||
} else if (context.keymods.alt) {
|
||||
openOptions = { pinned: true };
|
||||
}
|
||||
|
||||
let input = this.getInput();
|
||||
const input = this.getInput();
|
||||
if (input instanceof EditorInput) {
|
||||
let opts = this.getOptions();
|
||||
if (opts) {
|
||||
opts = objects.mixin(opts, openInBackgroundOptions, true);
|
||||
} else if (openInBackgroundOptions) {
|
||||
opts = EditorOptions.create(openInBackgroundOptions);
|
||||
opts = objects.mixin(opts, openOptions, true);
|
||||
} else if (openOptions) {
|
||||
opts = EditorOptions.create(openOptions);
|
||||
}
|
||||
|
||||
this.editorService.openEditor(input, opts, sideBySide).done(null, errors.onUnexpectedError);
|
||||
} else {
|
||||
const resourceInput = <IResourceInput>input;
|
||||
|
||||
if (openInBackgroundOptions) {
|
||||
resourceInput.options = objects.assign(resourceInput.options || Object.create(null), openInBackgroundOptions);
|
||||
if (openOptions) {
|
||||
resourceInput.options = objects.assign(resourceInput.options || Object.create(null), openOptions);
|
||||
}
|
||||
|
||||
this.editorService.openEditor(resourceInput, sideBySide).done(null, errors.onUnexpectedError);
|
||||
@@ -314,50 +314,6 @@ export class EditorQuickOpenEntryGroup extends QuickOpenEntryGroup implements IE
|
||||
}
|
||||
}
|
||||
|
||||
// Infrastructure for quick open commands
|
||||
|
||||
export interface ICommand {
|
||||
aliases: string[];
|
||||
getResults(input: string): TPromise<QuickOpenEntry[]>;
|
||||
getEmptyLabel(input: string): string;
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
class CommandEntry extends QuickOpenEntry {
|
||||
|
||||
constructor(private quickOpenService: IQuickOpenService, private prefix: string, private command: ICommand, highlights: IHighlight[]) {
|
||||
super(highlights);
|
||||
this.command = command;
|
||||
}
|
||||
|
||||
public getIcon(): string {
|
||||
return this.command.icon || null;
|
||||
}
|
||||
|
||||
public getLabel(): string {
|
||||
return this.command.aliases[0];
|
||||
}
|
||||
|
||||
public getAriaLabel(): string {
|
||||
return nls.localize('entryAriaLabel', "{0}, command", this.getLabel());
|
||||
}
|
||||
|
||||
public run(mode: Mode, context: IEntryRunContext): boolean {
|
||||
if (mode === Mode.PREVIEW) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.quickOpenService.show(`${this.prefix} ${this.command.aliases[0]} `);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export interface ICommandQuickOpenHandlerOptions {
|
||||
prefix: string;
|
||||
commands: ICommand[];
|
||||
defaultCommand?: ICommand;
|
||||
}
|
||||
|
||||
export class QuickOpenAction extends Action {
|
||||
private prefix: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user