import { URI } from "../../../../base/common/uri.js"; import { Emitter, Event } from "../../../../base/common/event.js"; import { ICodeEditor } from "../../../../editor/browser/editorBrowser.js"; import { IEditorOpenContext, IEditorPaneSelection, EditorPaneSelectionCompareResult, IEditorPaneWithSelection, IEditorPaneSelectionChangeEvent, IEditorPaneScrollPosition, IEditorPaneWithScrolling } from "../../../common/editor.js"; import { EditorInput } from "../../../common/editor/editorInput.js"; import { AbstractEditorWithViewState } from "./editorWithViewState.js"; import { IEditorViewState } from "../../../../editor/common/editorCommon.js"; import { Selection } from "../../../../editor/common/core/selection.js"; import { IStorageService } from "../../../../platform/storage/common/storage.service.js"; import { IInstantiationService } from "../../../../platform/instantiation/common/instantiation.js"; import { ITelemetryService } from "../../../../platform/telemetry/common/telemetry.service.js"; import { IThemeService } from "../../../../platform/theme/common/themeService.service.js"; import { ITextResourceConfigurationChangeEvent } from "../../../../editor/common/services/textResourceConfiguration.js"; import { ITextResourceConfigurationService } from "../../../../editor/common/services/textResourceConfiguration.service.js"; import { IEditorOptions as ICodeEditorOptions } from "../../../../editor/common/config/editorOptions.js"; import { IEditorGroup } from "../../../services/editor/common/editorGroupsService.js"; import { IEditorGroupsService } from "../../../services/editor/common/editorGroupsService.service.js"; import { CancellationToken } from "../../../../base/common/cancellation.js"; import { IEditorService } from "../../../services/editor/common/editorService.service.js"; import { IEditorOptions, ITextEditorOptions } from "../../../../platform/editor/common/editor.js"; import { IFileService } from "../../../../platform/files/common/files.service.js"; import { IMarkdownString } from "../../../../base/common/htmlContent.js"; export interface IEditorConfiguration { editor: object; diffEditor: object; accessibility?: { verbosity?: { diffEditor?: boolean; }; }; problems?: { visibility?: boolean; }; } /** * The base class of editors that leverage any kind of text editor for the editing experience. */ export declare abstract class AbstractTextEditor extends AbstractEditorWithViewState implements IEditorPaneWithSelection, IEditorPaneWithScrolling { protected readonly fileService: IFileService; private static readonly VIEW_STATE_PREFERENCE_KEY; protected readonly _onDidChangeSelection: Emitter; readonly onDidChangeSelection: Event; protected readonly _onDidChangeScroll: Emitter; readonly onDidChangeScroll: Event; private editorContainer; private hasPendingConfigurationChange; private lastAppliedEditorOptions?; private readonly inputListener; constructor(id: string, group: IEditorGroup, telemetryService: ITelemetryService, instantiationService: IInstantiationService, storageService: IStorageService, textResourceConfigurationService: ITextResourceConfigurationService, themeService: IThemeService, editorService: IEditorService, editorGroupService: IEditorGroupsService, fileService: IFileService); private handleConfigurationChangeEvent; protected shouldHandleConfigurationChangeEvent(e: ITextResourceConfigurationChangeEvent, resource: URI | undefined): boolean; private consumePendingConfigurationChangeEvent; protected computeConfiguration(configuration: IEditorConfiguration): ICodeEditorOptions; protected computeAriaLabel(): string; private onDidChangeFileSystemProvider; private onDidChangeInputCapabilities; protected updateReadonly(input: EditorInput): void; protected getReadonlyConfiguration(isReadonly: boolean | IMarkdownString | undefined): { readOnly: boolean; readOnlyMessage: IMarkdownString | undefined; }; protected getConfigurationOverrides(configuration: IEditorConfiguration): ICodeEditorOptions; protected createEditor(parent: HTMLElement): void; private registerCodeEditorListeners; private toEditorPaneSelectionChangeReason; getSelection(): IEditorPaneSelection | undefined; /** * This method creates and returns the text editor control to be used. * Subclasses must override to provide their own editor control that * should be used (e.g. a text diff editor). * * The passed in configuration object should be passed to the editor * control when creating it. */ protected abstract createEditorControl(parent: HTMLElement, initialOptions: ICodeEditorOptions): void; /** * The method asks to update the editor control options and is called * whenever there is change to the options. */ protected abstract updateEditorControlOptions(options: ICodeEditorOptions): void; /** * This method returns the main, dominant instance of `ICodeEditor` * for the editor pane. E.g. for a diff editor, this is the right * hand (modified) side. */ protected abstract getMainControl(): ICodeEditor | undefined; setInput(input: EditorInput, options: ITextEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise; clearInput(): void; getScrollPosition(): IEditorPaneScrollPosition; setScrollPosition(scrollPosition: IEditorPaneScrollPosition): void; protected setEditorVisible(visible: boolean): void; protected toEditorViewStateResource(input: EditorInput): URI | undefined; private updateEditorConfiguration; private getActiveResource; dispose(): void; } export declare class TextEditorPaneSelection implements IEditorPaneSelection { private readonly textSelection; private static readonly TEXT_EDITOR_SELECTION_THRESHOLD; constructor(textSelection: Selection); compare(other: IEditorPaneSelection): EditorPaneSelectionCompareResult; restore(options: IEditorOptions): ITextEditorOptions; log(): string; }