提交 3124d498 编写于 作者: B Benjamin Pasero

Editors: revisit IEditorPane extends IPanel (fix #91945)

上级 03e8f121
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Panel } from 'vs/workbench/browser/panel';
import { Composite } from 'vs/workbench/browser/composite';
import { EditorInput, EditorOptions, IEditorPane, GroupIdentifier, IEditorMemento } from 'vs/workbench/common/editor';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IThemeService } from 'vs/platform/theme/common/themeService';
......@@ -33,7 +33,7 @@ import { indexOfPath } from 'vs/base/common/extpath';
*
* This class is only intended to be subclassed and not instantiated.
*/
export abstract class BaseEditor extends Panel implements IEditorPane {
export abstract class BaseEditor extends Composite implements IEditorPane {
private static readonly EDITOR_MEMENTOS = new Map<string, EditorMemento<any>>();
......
......@@ -64,6 +64,10 @@ export function getEditorPartOptions(config: IWorkbenchEditorConfiguration): IEd
}
export interface IEditorOpeningEvent extends IEditorIdentifier {
/**
* The options used when opening the editor.
*/
options?: IEditorOptions;
/**
......
......@@ -16,7 +16,7 @@ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { Registry } from 'vs/platform/registry/common/platform';
import { ITextModel } from 'vs/editor/common/model';
import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { ICompositeControl } from 'vs/workbench/common/composite';
import { ICompositeControl, IComposite } from 'vs/workbench/common/composite';
import { ActionRunner, IAction } from 'vs/base/common/actions';
import { IFileService, FileSystemProviderCapabilities } from 'vs/platform/files/common/files';
import { IPathData } from 'vs/platform/windows/common/windows';
......@@ -24,7 +24,6 @@ import { coalesce, firstOrDefault } from 'vs/base/common/arrays';
import { ITextFileSaveOptions, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { IEditorService, IResourceEditorInputType } from 'vs/workbench/services/editor/common/editorService';
import { isEqual, dirname } from 'vs/base/common/resources';
import { IPanel } from 'vs/workbench/common/panel';
import { IRange } from 'vs/editor/common/core/range';
import { createMemoizer } from 'vs/base/common/decorators';
import { ILabelService } from 'vs/platform/label/common/label';
......@@ -64,7 +63,7 @@ export const BINARY_DIFF_EDITOR_ID = 'workbench.editors.binaryResourceDiffEditor
/**
* The editor pane is the container for workbench editors.
*/
export interface IEditorPane extends IPanel {
export interface IEditorPane extends IComposite {
/**
* The assigned input of this editor.
......@@ -102,7 +101,9 @@ export interface IEditorPane extends IPanel {
readonly onDidSizeConstraintsChange: Event<{ width: number; height: number; } | undefined>;
/**
* Returns the underlying control of this editor.
* Returns the underlying control of this editor. Callers need to cast
* the control to a specific instance as needed, e.g. by using the
* `isCodeEditor` helper method to access the text code editor.
*/
getControl(): IEditorControl | undefined;
......@@ -120,6 +121,9 @@ export interface IVisibleEditorPane extends IEditorPane {
readonly group: IEditorGroup;
}
/**
* The text editor pane is the container for workbench text editors.
*/
export interface ITextEditorPane extends IEditorPane {
/**
......@@ -139,6 +143,9 @@ export function isTextEditorPane(thing: IEditorPane | undefined): thing is IText
return typeof candidate?.getViewState === 'function';
}
/**
* The text editor pane is the container for workbench text diff editors.
*/
export interface ITextDiffEditorPane extends IEditorPane {
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册