提交 1c6e2f95 编写于 作者: B Benjamin Pasero

grid - adopt some next editor services in quick open

上级 82b09e61
......@@ -14,7 +14,7 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi
import { EditorInput } from 'vs/workbench/common/editor';
import { join, dirname } from 'vs/base/common/paths';
import { isWindows } from 'vs/base/common/platform';
import { INextEditorService, SIDE_BY_SIDE } from 'vs/workbench/services/editor/common/nextEditorService';
import { INextEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/nextEditorService';
function getVSCodeBaseFolder(): string {
let workingDir = process.cwd();
......@@ -138,7 +138,7 @@ export class GridOpenOneEditorSideBySideAction extends Action {
run(): TPromise<any> {
const path = join(getVSCodeBaseFolder(), 'src/vs/workbench/browser/parts/editor/editor.contribution.ts');
this.editorService.openEditor(this.legacyEditorService.createInput({ resource: URI.file(path) }) as EditorInput, null, SIDE_BY_SIDE);
this.editorService.openEditor(this.legacyEditorService.createInput({ resource: URI.file(path) }) as EditorInput, null, SIDE_GROUP);
return TPromise.as(void 0);
}
......
......@@ -34,7 +34,6 @@ import { Event, Emitter } from 'vs/base/common/event';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { QuickOpenHandler, QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions, EditorQuickOpenEntry, CLOSE_ON_FOCUS_LOST_CONFIG } from 'vs/workbench/browser/quickopen';
import * as errors from 'vs/base/common/errors';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IPickOpenEntry, IFilePickOpenEntry, IQuickOpenService, IPickOptions, IShowOptions, IPickOpenItem } from 'vs/platform/quickOpen/common/quickOpen';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
......@@ -56,6 +55,7 @@ import { Schemas } from 'vs/base/common/network';
import Severity from 'vs/base/common/severity';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { Dimension, addClass } from 'vs/base/browser/dom';
import { INextEditorService, ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/editor/common/nextEditorService';
const HELP_PREFIX = '?';
......@@ -101,7 +101,7 @@ export class QuickOpenController extends Component implements IQuickOpenService
private editorHistoryHandler: EditorHistoryHandler;
constructor(
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@INextEditorService private editorService: INextEditorService,
@INotificationService private notificationService: INotificationService,
@IContextKeyService private contextKeyService: IContextKeyService,
@IConfigurationService private configurationService: IConfigurationService,
......@@ -514,7 +514,7 @@ export class QuickOpenController extends Component implements IQuickOpenService
if (!quickNavigateConfiguration) {
autoFocus = { autoFocusFirstEntry: true };
} else {
const visibleEditorCount = this.editorService.getVisibleEditors().length;
const visibleEditorCount = this.editorService.visibleEditors.length;
autoFocus = { autoFocusFirstEntry: visibleEditorCount === 0, autoFocusSecondEntry: visibleEditorCount !== 0 };
}
}
......@@ -635,9 +635,9 @@ export class QuickOpenController extends Component implements IQuickOpenService
private restoreFocus(): void {
// Try to focus active editor
const editor = this.editorService.getActiveEditor();
if (editor) {
editor.focus();
const editorControl = this.editorService.activeControl;
if (editorControl) {
editorControl.focus();
}
}
......@@ -1184,7 +1184,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
constructor(
input: IEditorInput | IResourceInput,
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
@INextEditorService editorService: INextEditorService,
@IModeService private modeService: IModeService,
@IModelService private modelService: IModelService,
@ITextFileService private textFileService: ITextFileService,
......@@ -1251,9 +1251,9 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
const pinned = !this.configurationService.getValue<IWorkbenchEditorConfiguration>().workbench.editor.enablePreviewFromQuickOpen || context.keymods.alt;
if (this.input instanceof EditorInput) {
this.editorService.openEditor(this.input, { pinned }, sideBySide).done(null, errors.onUnexpectedError);
this.editorService.openEditor(this.input, { pinned }, sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
} else {
this.editorService.openEditor({ resource: (this.input as IResourceInput).resource, options: { pinned } }, sideBySide);
this.editorService.openEditor({ resource: (this.input as IResourceInput).resource, options: { pinned } }, sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
}
return true;
......
......@@ -10,16 +10,15 @@ import * as objects from 'vs/base/common/objects';
import * as arrays from 'vs/base/common/arrays';
import * as strings from 'vs/base/common/strings';
import * as types from 'vs/base/common/types';
import * as errors from 'vs/base/common/errors';
import { Registry } from 'vs/platform/registry/common/platform';
import { Action } from 'vs/base/common/actions';
import { Mode, IEntryRunContext, IAutoFocus, IModel, IQuickNavigateConfiguration } from 'vs/base/parts/quickopen/common/quickOpen';
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';
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
import { IConstructorSignature0, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { INextEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/nextEditorService';
export const CLOSE_ON_FOCUS_LOST_CONFIG = 'workbench.quickOpen.closeOnFocusLost';
......@@ -246,7 +245,7 @@ export interface IEditorQuickOpenEntry {
*/
export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuickOpenEntry {
constructor(private _editorService: IWorkbenchEditorService) {
constructor(private _editorService: INextEditorService) {
super();
}
......@@ -284,7 +283,7 @@ export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuick
opts = EditorOptions.create(openOptions);
}
this.editorService.openEditor(input, opts, sideBySide).done(null, errors.onUnexpectedError);
this.editorService.openEditor(input, opts, sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
} else {
const resourceInput = <IResourceInput>input;
......@@ -292,7 +291,7 @@ export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuick
resourceInput.options = objects.assign(resourceInput.options || Object.create(null), openOptions);
}
this.editorService.openEditor(resourceInput, sideBySide).done(null, errors.onUnexpectedError);
this.editorService.openEditor(resourceInput, sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
}
}
......
......@@ -7,12 +7,11 @@
import { TPromise } from 'vs/base/common/winjs.base';
import * as nls from 'vs/nls';
import * as types from 'vs/base/common/types';
import * as errors from 'vs/base/common/errors';
import { IEntryRunContext, Mode, IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen';
import { QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel';
import { QuickOpenHandler, EditorQuickOpenEntry, QuickOpenAction } from 'vs/workbench/browser/quickopen';
import { IEditor, IEditorViewState, IDiffEditorModel, ScrollType } from 'vs/editor/common/editorCommon';
import { IModelDecorationsChangeAccessor, OverviewRulerLane, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model';
import { OverviewRulerLane, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { Position, IEditorInput, ITextEditorOptions } from 'vs/platform/editor/common/editor';
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
......@@ -21,6 +20,7 @@ import { IRange } from 'vs/editor/common/core/range';
import { overviewRulerRangeHighlight } from 'vs/editor/common/view/editorColorRegistry';
import { themeColorFromId } from 'vs/platform/theme/common/themeService';
import { IEditorOptions, RenderLineNumbersType } from 'vs/editor/common/config/editorOptions';
import { INextEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/nextEditorService';
export const GOTO_LINE_PREFIX = ':';
......@@ -75,7 +75,7 @@ class GotoLineEntry extends EditorQuickOpenEntry {
private column: number;
private handler: GotoLineHandler;
constructor(line: string, editorService: IWorkbenchEditorService, handler: GotoLineHandler) {
constructor(line: string, editorService: INextEditorService, handler: GotoLineHandler) {
super(editorService);
this.parseInput(line);
......@@ -109,9 +109,9 @@ class GotoLineEntry extends EditorQuickOpenEntry {
}
private getMaxLineNumber(): number {
const editor = this.editorService.getActiveEditor();
const editorControl = <IEditor>editor.getControl();
let model = editorControl.getModel();
const codeEditor = this.editorService.activeTextEditorControl;
let model = codeEditor.getModel();
if (model && (<IDiffEditorModel>model).modified && (<IDiffEditorModel>model).original) {
model = (<IDiffEditorModel>model).modified; // Support for diff editor models
}
......@@ -128,7 +128,7 @@ class GotoLineEntry extends EditorQuickOpenEntry {
}
public getInput(): IEditorInput {
return this.editorService.getActiveEditorInput();
return this.editorService.activeEditor;
}
public getOptions(pinned?: boolean): ITextEditorOptions {
......@@ -148,16 +148,15 @@ class GotoLineEntry extends EditorQuickOpenEntry {
// Check for sideBySide use
const sideBySide = context.keymods.ctrlCmd;
if (sideBySide) {
this.editorService.openEditor(this.getInput(), this.getOptions(context.keymods.alt), true).done(null, errors.onUnexpectedError);
this.editorService.openEditor(this.getInput(), this.getOptions(context.keymods.alt), SIDE_GROUP);
}
// Apply selection and focus
const range = this.toSelection();
const activeEditor = this.editorService.getActiveEditor();
if (activeEditor) {
const editor = <IEditor>activeEditor.getControl();
editor.setSelection(range);
editor.revealRangeInCenter(range, ScrollType.Smooth);
const codeEditor = this.editorService.activeTextEditorControl;
if (codeEditor) {
codeEditor.setSelection(range);
codeEditor.revealRangeInCenter(range, ScrollType.Smooth);
}
return true;
......@@ -174,14 +173,13 @@ class GotoLineEntry extends EditorQuickOpenEntry {
// Select Line Position
const range = this.toSelection();
const activeEditor = this.editorService.getActiveEditor();
if (activeEditor) {
const editorControl = <IEditor>activeEditor.getControl();
editorControl.revealRangeInCenter(range, ScrollType.Smooth);
const codeEditor = this.editorService.activeTextEditorControl;
if (codeEditor) {
codeEditor.revealRangeInCenter(range, ScrollType.Smooth);
// Decorate if possible
if (types.isFunction(editorControl.changeDecorations)) {
this.handler.decorateOutline(range, editorControl, activeEditor.position);
if (types.isFunction(codeEditor.changeDecorations)) {
this.handler.decorateOutline(range, codeEditor, 0 /* TODO@grid activeEditor.position */);
}
}
......@@ -211,7 +209,7 @@ export class GotoLineHandler extends QuickOpenHandler {
private rangeHighlightDecorationId: IEditorLineDecoration;
private lastKnownEditorViewState: IEditorViewState;
constructor(@IWorkbenchEditorService private editorService: IWorkbenchEditorService) {
constructor(@INextEditorService private editorService: INextEditorService) {
super();
}
......@@ -224,21 +222,21 @@ export class GotoLineHandler extends QuickOpenHandler {
// Remember view state to be able to restore on cancel
if (!this.lastKnownEditorViewState) {
const editor = this.editorService.getActiveEditor();
this.lastKnownEditorViewState = (<IEditor>editor.getControl()).saveViewState();
const codeEditor = this.editorService.activeTextEditorControl;
this.lastKnownEditorViewState = codeEditor.saveViewState();
}
return TPromise.as(new QuickOpenModel([new GotoLineEntry(searchValue, this.editorService, this)]));
}
public canRun(): boolean | string {
const canRun = getCodeEditor(this.editorService.getActiveEditor()) !== null;
const canRun = !!this.editorService.activeTextEditorControl;
return canRun ? true : nls.localize('cannotRunGotoLine', "Open a text file first to go to a line");
}
public decorateOutline(range: IRange, editor: IEditor, position: Position): void {
editor.changeDecorations((changeAccessor: IModelDecorationsChangeAccessor) => {
editor.changeDecorations(changeAccessor => {
const deleteDecorations: string[] = [];
if (this.rangeHighlightDecorationId) {
......@@ -284,10 +282,10 @@ export class GotoLineHandler extends QuickOpenHandler {
public clearDecorations(): void {
if (this.rangeHighlightDecorationId) {
this.editorService.getVisibleEditors().forEach((editor) => {
this.editorService.visibleControls.forEach(editor => {
if (editor.position === this.rangeHighlightDecorationId.position) {
const editorControl = <IEditor>editor.getControl();
editorControl.changeDecorations((changeAccessor: IModelDecorationsChangeAccessor) => {
editorControl.changeDecorations(changeAccessor => {
changeAccessor.deltaDecorations([
this.rangeHighlightDecorationId.lineDecorationId,
this.rangeHighlightDecorationId.rangeHighlightId
......@@ -307,10 +305,9 @@ export class GotoLineHandler extends QuickOpenHandler {
// Restore selection if canceled
if (canceled && this.lastKnownEditorViewState) {
const activeEditor = this.editorService.getActiveEditor();
if (activeEditor) {
const editor = <IEditor>activeEditor.getControl();
editor.restoreViewState(this.lastKnownEditorViewState);
const codeEditor = this.editorService.activeTextEditorControl;
if (codeEditor) {
codeEditor.restoreViewState(this.lastKnownEditorViewState);
}
}
......
......@@ -25,7 +25,6 @@ import { QueryBuilder } from 'vs/workbench/parts/search/common/queryBuilder';
import { EditorInput, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { IResourceInput } from 'vs/platform/editor/common/editor';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IQueryOptions, ISearchService, ISearchStats, ISearchQuery } from 'vs/platform/search/common/search';
......@@ -33,6 +32,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IRange } from 'vs/editor/common/core/range';
import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/common/search';
import { INextEditorService } from 'vs/workbench/services/editor/common/nextEditorService';
export class FileQuickOpenModel extends QuickOpenModel {
......@@ -49,7 +49,7 @@ export class FileEntry extends EditorQuickOpenEntry {
private name: string,
private description: string,
private icon: string,
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
@INextEditorService editorService: INextEditorService,
@IModeService private modeService: IModeService,
@IModelService private modelService: IModelService,
@IConfigurationService private configurationService: IConfigurationService,
......
......@@ -19,13 +19,13 @@ import { EditorInput, IWorkbenchEditorConfiguration } from 'vs/workbench/common/
import * as labels from 'vs/base/common/labels';
import { SymbolInformation, symbolKindToCssClass } from 'vs/editor/common/modes';
import { IResourceInput } from 'vs/platform/editor/common/editor';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IWorkspaceSymbolProvider, getWorkspaceSymbols } from 'vs/workbench/parts/search/common/search';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { basename } from 'vs/base/common/paths';
import { INextEditorService } from 'vs/workbench/services/editor/common/nextEditorService';
class SymbolEntry extends EditorQuickOpenEntry {
......@@ -36,7 +36,7 @@ class SymbolEntry extends EditorQuickOpenEntry {
private _provider: IWorkspaceSymbolProvider,
@IConfigurationService private readonly _configurationService: IConfigurationService,
@IWorkspaceContextService private readonly _contextService: IWorkspaceContextService,
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
@INextEditorService editorService: INextEditorService,
@IEnvironmentService private readonly _environmentService: IEnvironmentService
) {
super(editorService);
......
......@@ -25,7 +25,7 @@ import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
import { localize } from 'vs/nls';
import { TPromise } from 'vs/base/common/winjs.base';
import { INextEditorGroupsService, INextEditorGroup, GroupDirection } from 'vs/workbench/services/group/common/nextEditorGroupsService';
import { INextEditorService, IResourceEditor, SIDE_BY_SIDE_TYPE, SIDE_BY_SIDE } from 'vs/workbench/services/editor/common/nextEditorService';
import { INextEditorService, IResourceEditor, ACTIVE_GROUP_TYPE, SIDE_GROUP_TYPE, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/nextEditorService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle';
import { coalesce } from 'vs/base/common/arrays';
......@@ -161,15 +161,19 @@ export class NextEditorService extends Disposable implements INextEditorService
return coalesce(this.nextEditorGroupsService.groups.map(group => group.activeControl));
}
get visibleTextEditorControls(): ICodeEditor[] {
return this.visibleControls.map(control => control.getControl() as ICodeEditor).filter(widget => isCodeEditor(widget));
}
get visibleEditors(): IEditorInput[] {
return coalesce(this.nextEditorGroupsService.groups.map(group => group.activeEditor));
}
//#region openEditor()
openEditor(editor: IEditorInput, options?: IEditorOptions, group?: GroupIdentifier | SIDE_BY_SIDE_TYPE): Thenable<IEditor>;
openEditor(editor: IResourceEditor, group?: GroupIdentifier | SIDE_BY_SIDE_TYPE): Thenable<IEditor>;
openEditor(editor: IEditorInput | IResourceEditor, optionsOrGroup?: IEditorOptions | GroupIdentifier, group?: GroupIdentifier): Thenable<IEditor> {
openEditor(editor: IEditorInput, options?: IEditorOptions, group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Thenable<IEditor>;
openEditor(editor: IResourceEditor, group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Thenable<IEditor>;
openEditor(editor: IEditorInput | IResourceEditor, optionsOrGroup?: IEditorOptions | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE, group?: GroupIdentifier): Thenable<IEditor> {
// Typed Editor Support
if (editor instanceof EditorInput) {
......@@ -201,11 +205,16 @@ export class NextEditorService extends Disposable implements INextEditorService
return TPromise.wrap<IEditor>(null);
}
private findTargetGroup(input: IEditorInput, options?: IEditorOptions, group?: GroupIdentifier | SIDE_BY_SIDE_TYPE): INextEditorGroup {
private findTargetGroup(input: IEditorInput, options?: IEditorOptions, group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): INextEditorGroup {
let targetGroup: INextEditorGroup;
// Group: Active Group
if (group === ACTIVE_GROUP) {
targetGroup = this.nextEditorGroupsService.activeGroup;
}
// Group: Side by Side
if (group === SIDE_BY_SIDE) {
else if (group === SIDE_GROUP) {
targetGroup = this.createSideBySideGroup();
}
......@@ -270,9 +279,9 @@ export class NextEditorService extends Disposable implements INextEditorService
//#region openEditors()
openEditors(editors: IEditorInputWithOptions[], group?: GroupIdentifier | SIDE_BY_SIDE_TYPE): Thenable<IEditor[]>;
openEditors(editors: IResourceEditor[], group?: GroupIdentifier | SIDE_BY_SIDE_TYPE): Thenable<IEditor[]>;
openEditors(editors: (IEditorInputWithOptions | IResourceEditor)[], group?: GroupIdentifier | SIDE_BY_SIDE_TYPE): Thenable<IEditor[]> {
openEditors(editors: IEditorInputWithOptions[], group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Thenable<IEditor[]>;
openEditors(editors: IResourceEditor[], group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Thenable<IEditor[]>;
openEditors(editors: (IEditorInputWithOptions | IResourceEditor)[], group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Thenable<IEditor[]> {
// Convert to typed editors and options
const typedEditors: IEditorInputWithOptions[] = [];
......@@ -286,7 +295,7 @@ export class NextEditorService extends Disposable implements INextEditorService
// Find target groups to open
const mapGroupToEditors = new Map<INextEditorGroup, IEditorInputWithOptions[]>();
if (group === SIDE_BY_SIDE) {
if (group === SIDE_GROUP) {
mapGroupToEditors.set(this.createSideBySideGroup(), typedEditors);
} else {
typedEditors.forEach(typedEditor => {
......
......@@ -15,8 +15,11 @@ export const INextEditorService = createDecorator<INextEditorService>('nextEdito
export type IResourceEditor = IResourceInput | IUntitledResourceInput | IResourceDiffInput | IResourceSideBySideInput;
export const SIDE_BY_SIDE = -1;
export type SIDE_BY_SIDE_TYPE = typeof SIDE_BY_SIDE;
export const ACTIVE_GROUP = -1;
export type ACTIVE_GROUP_TYPE = typeof ACTIVE_GROUP;
export const SIDE_GROUP = -2;
export type SIDE_GROUP_TYPE = typeof SIDE_GROUP;
export interface INextEditorService {
_serviceBrand: ServiceIdentifier<any>;
......@@ -68,6 +71,11 @@ export interface INextEditorService {
*/
readonly visibleControls: ReadonlyArray<IEditor>;
/**
* All text editor controls that are currently visible across all editor groups.
*/
readonly visibleTextEditorControls: ICodeEditor[];
/**
* All editors that are currently visible across all editor groups.
*/
......@@ -79,31 +87,31 @@ export interface INextEditorService {
* @param editor the editor to open
* @param options the options to use for the editor
* @param group the target group. If unspecified, the editor will open in the currently
* active group. Use `SIDE_BY_SIDE` to open the editor in a new editor group to the side
* active group. Use `SIDE_GROUP_TYPE` to open the editor in a new editor group to the side
* of the currently active group.
*/
openEditor(editor: IEditorInput, options?: IEditorOptions, group?: GroupIdentifier | SIDE_BY_SIDE_TYPE): Thenable<IEditor>;
openEditor(editor: IEditorInput, options?: IEditorOptions, group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Thenable<IEditor>;
/**
* Open an editor in an editor group.
*
* @param editor the editor to open
* @param group the target group. If unspecified, the editor will open in the currently
* active group. Use `SIDE_BY_SIDE` to open the editor in a new editor group to the side
* active group. Use `SIDE_GROUP_TYPE` to open the editor in a new editor group to the side
* of the currently active group.
*/
openEditor(editor: IResourceEditor, group?: GroupIdentifier | SIDE_BY_SIDE_TYPE): Thenable<IEditor>;
openEditor(editor: IResourceEditor, group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Thenable<IEditor>;
/**
* Open editors in an editor group.
*
* @param editors the editors to open with associated options
* @param group the target group. If unspecified, the editor will open in the currently
* active group. Use `SIDE_BY_SIDE` to open the editor in a new editor group to the side
* active group. Use `SIDE_GROUP_TYPE` to open the editor in a new editor group to the side
* of the currently active group.
*/
openEditors(editors: IEditorInputWithOptions[], group?: GroupIdentifier | SIDE_BY_SIDE_TYPE): Thenable<IEditor[]>;
openEditors(editors: IResourceEditor[], group?: GroupIdentifier | SIDE_BY_SIDE_TYPE): Thenable<IEditor[]>;
openEditors(editors: IEditorInputWithOptions[], group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Thenable<IEditor[]>;
openEditors(editors: IResourceEditor[], group?: GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Thenable<IEditor[]>;
/**
* Find out if the provided editor (or resource of an editor) is opened in any group.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册