x4js - v2.2.49
    Preparing search index...

    An editor.

    interface IEditor {
        createDecorationsCollection(
            decorations?: IModelDeltaDecoration[],
        ): IEditorDecorationsCollection;
        dispose(): void;
        focus(): void;
        getEditorType(): string;
        getId(): string;
        getModel(): IEditorModel;
        getPosition(): Position;
        getSelection(): Selection;
        getSelections(): Selection[];
        getSupportedActions(): IEditorAction[];
        getVisibleColumnFromPosition(position: IPosition): number;
        hasTextFocus(): boolean;
        layout(dimension?: IDimension, postponeRendering?: boolean): void;
        onDidDispose(listener: () => void): IDisposable;
        restoreViewState(state: IEditorViewState): void;
        revealLine(lineNumber: number, scrollType?: ScrollType): void;
        revealLineInCenter(lineNumber: number, scrollType?: ScrollType): void;
        revealLineInCenterIfOutsideViewport(
            lineNumber: number,
            scrollType?: ScrollType,
        ): void;
        revealLineNearTop(lineNumber: number, scrollType?: ScrollType): void;
        revealLines(
            startLineNumber: number,
            endLineNumber: number,
            scrollType?: ScrollType,
        ): void;
        revealLinesInCenter(
            lineNumber: number,
            endLineNumber: number,
            scrollType?: ScrollType,
        ): void;
        revealLinesInCenterIfOutsideViewport(
            lineNumber: number,
            endLineNumber: number,
            scrollType?: ScrollType,
        ): void;
        revealLinesNearTop(
            lineNumber: number,
            endLineNumber: number,
            scrollType?: ScrollType,
        ): void;
        revealPosition(position: IPosition, scrollType?: ScrollType): void;
        revealPositionInCenter(position: IPosition, scrollType?: ScrollType): void;
        revealPositionInCenterIfOutsideViewport(
            position: IPosition,
            scrollType?: ScrollType,
        ): void;
        revealPositionNearTop(position: IPosition, scrollType?: ScrollType): void;
        revealRange(range: IRange, scrollType?: ScrollType): void;
        revealRangeAtTop(range: IRange, scrollType?: ScrollType): void;
        revealRangeInCenter(range: IRange, scrollType?: ScrollType): void;
        revealRangeInCenterIfOutsideViewport(
            range: IRange,
            scrollType?: ScrollType,
        ): void;
        revealRangeNearTop(range: IRange, scrollType?: ScrollType): void;
        revealRangeNearTopIfOutsideViewport(
            range: IRange,
            scrollType?: ScrollType,
        ): void;
        saveViewState(): IEditorViewState;
        setModel(model: IEditorModel): void;
        setPosition(position: IPosition, source?: string): void;
        setSelection(selection: IRange, source?: string): void;
        setSelection(selection: Range, source?: string): void;
        setSelection(selection: ISelection, source?: string): void;
        setSelection(selection: Selection, source?: string): void;
        setSelections(selections: readonly ISelection[], source?: string): void;
        trigger(source: string, handlerId: string, payload: unknown): void;
        updateOptions(newOptions: IEditorOptions): void;
    }

    Hierarchy (View Summary)

    Index
    • Instructs the editor to remeasure its container. This method should be called when the container of the editor gets resized.

      If a dimension is passed in, the passed in value will be used.

      By default, this will also render the editor immediately. If you prefer to delay rendering to the next animation frame, use postponeRendering == true.

      Parameters

      • Optionaldimension: IDimension
      • OptionalpostponeRendering: boolean

      Returns void

    • Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.

      Parameters

      • lineNumber: number
      • OptionalscrollType: ScrollType

      Returns void

    • Scroll vertically as necessary and reveal a line close to the top of the viewport, optimized for viewing a code definition.

      Parameters

      • lineNumber: number
      • OptionalscrollType: ScrollType

      Returns void

    • Scroll vertically as necessary and reveal lines.

      Parameters

      • startLineNumber: number
      • endLineNumber: number
      • OptionalscrollType: ScrollType

      Returns void

    • Scroll vertically as necessary and reveal lines centered vertically.

      Parameters

      • lineNumber: number
      • endLineNumber: number
      • OptionalscrollType: ScrollType

      Returns void

    • Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.

      Parameters

      • lineNumber: number
      • endLineNumber: number
      • OptionalscrollType: ScrollType

      Returns void

    • Scroll vertically as necessary and reveal lines close to the top of the viewport, optimized for viewing a code definition.

      Parameters

      • lineNumber: number
      • endLineNumber: number
      • OptionalscrollType: ScrollType

      Returns void

    • Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, optimized for viewing a code definition. Only if it lies outside the viewport.

      Parameters

      Returns void

    • Sets the current model attached to this editor. If the previous model was created by the editor via the value key in the options literal object, it will be destroyed. Otherwise, if the previous model was set via setModel, or the model key in the options literal object, the previous model will not be destroyed. It is safe to call setModel(null) to simply detach the current model from the editor.

      Parameters

      Returns void

    • Set the primary position of the cursor. This will remove any secondary cursors.

      Parameters

      • position: IPosition

        New primary cursor's position

      • Optionalsource: string

        Source of the call that caused the position

      Returns void

    • Set the primary selection of the editor. This will remove any secondary cursors.

      Parameters

      • selection: IRange

        The new selection

      • Optionalsource: string

        Source of the call that caused the selection

      Returns void

    • Set the primary selection of the editor. This will remove any secondary cursors.

      Parameters

      • selection: Range

        The new selection

      • Optionalsource: string

        Source of the call that caused the selection

      Returns void

    • Set the primary selection of the editor. This will remove any secondary cursors.

      Parameters

      • selection: ISelection

        The new selection

      • Optionalsource: string

        Source of the call that caused the selection

      Returns void

    • Set the primary selection of the editor. This will remove any secondary cursors.

      Parameters

      • selection: Selection

        The new selection

      • Optionalsource: string

        Source of the call that caused the selection

      Returns void

    • Set the selections for all the cursors of the editor. Cursors will be removed or added, as necessary.

      Parameters

      • selections: readonly ISelection[]

        The new selection

      • Optionalsource: string

        Source of the call that caused the selection

      Returns void

    • Directly trigger a handler or an editor action.

      Parameters

      • source: string

        The source of the call.

      • handlerId: string

        The id of the handler or the id of a contribution.

      • payload: unknown

        Extra data to be sent to the handler.

      Returns void