An editor.

Hierarchy

Index

Events

onDidDispose

Methods

dispose

  • dispose(): void

focus

  • focus(): void

getEditorType

  • getEditorType(): string
  • Get the editor type. Please see EditorType. This is to avoid an instanceof check

    Returns string

getId

  • getId(): string

getModel

getPosition

getSelection

getSelections

getSupportedActions

getVisibleColumnFromPosition

  • getVisibleColumnFromPosition(position: IPosition): number

hasTextFocus

  • hasTextFocus(): boolean
  • Returns true if the text inside this editor is focused (i.e. cursor is blinking).

    Returns boolean

layout

  • 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.

    Parameters

    Returns void

restoreViewState

revealLine

  • revealLine(lineNumber: number, scrollType?: ScrollType): void

revealLineInCenter

  • revealLineInCenter(lineNumber: number, scrollType?: ScrollType): void
  • Scroll vertically as necessary and reveal a line centered vertically.

    Parameters

    • lineNumber: number
    • Optional scrollType: ScrollType

    Returns void

revealLineInCenterIfOutsideViewport

  • revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void
  • Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.

    Parameters

    • lineNumber: number
    • Optional scrollType: ScrollType

    Returns void

revealLineNearTop

  • revealLineNearTop(lineNumber: number, scrollType?: ScrollType): 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
    • Optional scrollType: ScrollType

    Returns void

revealLines

  • revealLines(startLineNumber: number, endLineNumber: number, scrollType?: ScrollType): void
  • Scroll vertically as necessary and reveal lines.

    Parameters

    • startLineNumber: number
    • endLineNumber: number
    • Optional scrollType: ScrollType

    Returns void

revealLinesInCenter

  • revealLinesInCenter(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void
  • Scroll vertically as necessary and reveal lines centered vertically.

    Parameters

    • lineNumber: number
    • endLineNumber: number
    • Optional scrollType: ScrollType

    Returns void

revealLinesInCenterIfOutsideViewport

  • revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void
  • Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.

    Parameters

    • lineNumber: number
    • endLineNumber: number
    • Optional scrollType: ScrollType

    Returns void

revealLinesNearTop

  • revealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): 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
    • Optional scrollType: ScrollType

    Returns void

revealPosition

revealPositionInCenter

revealPositionInCenterIfOutsideViewport

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

    Parameters

    Returns void

revealPositionNearTop

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

    Parameters

    Returns void

revealRange

revealRangeAtTop

  • Scroll vertically or horizontally as necessary and reveal a range at the top of the viewport.

    Parameters

    Returns void

revealRangeInCenter

revealRangeInCenterIfOutsideViewport

  • revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void
  • Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.

    Parameters

    Returns void

revealRangeNearTop

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

    Parameters

    Returns void

revealRangeNearTopIfOutsideViewport

  • revealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): 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

saveViewState

setModel

  • 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

setPosition

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

    Parameters

    • position: IPosition

      New primary cursor's position

    Returns void

setSelection

  • setSelection(selection: IRange): void
  • setSelection(selection: Range): void
  • setSelection(selection: ISelection): void
  • setSelection(selection: Selection): void
  • Set the primary selection of the editor. This will remove any secondary cursors.

    Parameters

    • selection: IRange

      The new selection

    Returns void

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

    Parameters

    • selection: Range

      The new selection

    Returns void

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

    Parameters

    Returns void

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

    Parameters

    Returns void

setSelections

  • setSelections(selections: readonly ISelection[]): void
  • Set the selections for all the cursors of the editor. Cursors will be removed or added, as necessary.

    Parameters

    Returns void

trigger

  • trigger(source: string, handlerId: string, payload: any): 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: any

      Extra data to be sent to the handler.

    Returns void

updateOptions