Hierarchy

Index

Events

onDidBlurEditor

  • An event emitted when the text inside this editor or an editor widget lost focus.

    Parameters

    • listener: function
        • (): void
        • Returns void

    Returns IDisposable

onDidBlurEditorText

  • An event emitted when the text inside this editor lost focus.

    Parameters

    • listener: function
        • (): void
        • Returns void

    Returns IDisposable

onDidChangeConfiguration

  • onDidChangeConfiguration(listener: function): IDisposable

onDidChangeCursorPosition

  • onDidChangeCursorPosition(listener: function): IDisposable

onDidChangeCursorSelection

  • onDidChangeCursorSelection(listener: function): IDisposable

onDidChangeModel

onDidChangeModelContent

  • onDidChangeModelContent(listener: function): IDisposable

onDidChangeModelDecorations

  • onDidChangeModelDecorations(listener: function): IDisposable

onDidChangeModelLanguage

  • onDidChangeModelLanguage(listener: function): IDisposable

onDidChangeModelOptions

  • onDidChangeModelOptions(listener: function): IDisposable

onDidDispose

onDidFocusEditor

  • An event emitted when the text inside this editor or an editor widget gained focus.

    Parameters

    • listener: function
        • (): void
        • Returns void

    Returns IDisposable

onDidFocusEditorText

  • onDidFocusEditorText(listener: function): IDisposable
  • An event emitted when the text inside this editor gained focus (i.e. cursor blinking).

    Parameters

    • listener: function
        • (): void
        • Returns void

    Returns IDisposable

Methods

deltaDecorations

  • deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[]
  • All decorations added through this call will get the ownerId of this editor.

    see

    IModel.deltaDecorations

    Parameters

    • oldDecorations: string[]
    • newDecorations: IModelDeltaDecoration[]

    Returns string[]

dispose

  • dispose(): void

executeCommand

  • executeCommand(source: string, command: ICommand): void
  • Execute a command on the editor. The edits will land on the undo-redo stack, but no "undo stop" will be pushed.

    Parameters

    • source: string

      The source of the call.

    • command: ICommand

      The command to execute

    Returns void

executeCommands

  • executeCommands(source: string, commands: ICommand[]): void
  • Execute multiple (concommitent) commands on the editor.

    Parameters

    • source: string

      The source of the call.

    • commands: ICommand[]

    Returns void

executeEdits

  • executeEdits(source: string, edits: IIdentifiedSingleEditOperation[], endCursoState?: Selection[]): boolean
  • Execute edits on the editor. The edits will land on the undo-redo stack, but no "undo stop" will be pushed.

    Parameters

    • source: string

      The source of the call.

    • edits: IIdentifiedSingleEditOperation[]

      The edits to execute.

    • Optional endCursoState: Selection[]

      Cursor state after the edits were applied.

    Returns boolean

focus

  • focus(): void

getAction

  • Get an action that is a contribution to this editor.

    id

    Unique identifier of the contribution.

    Parameters

    • id: string

    Returns IEditorAction

    The action or null if action not found.

getActions

  • getActions(): IEditorAction[]

getConfiguration

getContribution

  • getContribution<T>(id: string): T
  • Get a contribution of this editor.

    id

    Unique identifier of the contribution.

    Type parameters

    Parameters

    • id: string

    Returns T

    The contribution or null if contribution not found.

getEditorType

  • getEditorType(): string

getId

  • getId(): string

getLayoutInfo

getLineDecorations

  • getLineDecorations(lineNumber: number): IModelDecoration[]
  • Get all the decorations on a line (filtering out decorations from other editors).

    Parameters

    • lineNumber: number

    Returns IModelDecoration[]

getModel

getPosition

getScrollHeight

  • getScrollHeight(): number
  • Get the scrollHeight of the editor's viewport.

    Returns number

getScrollLeft

  • getScrollLeft(): number
  • Get the scrollLeft of the editor's viewport.

    Returns number

getScrollTop

  • getScrollTop(): number
  • Get the scrollTop of the editor's viewport.

    Returns number

getScrollWidth

  • getScrollWidth(): number
  • Get the scrollWidth of the editor's viewport.

    Returns number

getSelection

getSelections

  • getSelections(): Selection[]

getSupportedActions

  • getSupportedActions(): IEditorAction[]

getValue

  • getValue(options?: object): string
  • Get value of the current model attached to this editor.

    see

    IModel.getValue

    Parameters

    • Optional options: object
      • lineEnding: string
      • preserveBOM: boolean

    Returns string

getVisibleColumnFromPosition

  • getVisibleColumnFromPosition(position: IPosition): number

hasWidgetFocus

  • hasWidgetFocus(): boolean
  • Returns true if this editor or one of its widgets has keyboard focus.

    Returns boolean

isFocused

  • isFocused(): boolean

layout

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

    Parameters

    Returns void

pushUndoStop

  • pushUndoStop(): boolean
  • Push an "undo stop" in the undo-redo stack.

    Returns boolean

restoreViewState

revealLine

  • revealLine(lineNumber: number): void

revealLineInCenter

  • revealLineInCenter(lineNumber: number): void

revealLineInCenterIfOutsideViewport

  • revealLineInCenterIfOutsideViewport(lineNumber: number): void

revealLines

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

    Parameters

    • startLineNumber: number
    • endLineNumber: number

    Returns void

revealLinesInCenter

  • revealLinesInCenter(lineNumber: number, endLineNumber: number): void

revealLinesInCenterIfOutsideViewport

  • revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number): void

revealPosition

  • revealPosition(position: IPosition, revealVerticalInCenter?: boolean, revealHorizontal?: boolean): void
  • Scroll vertically or horizontally as necessary and reveal a position.

    Parameters

    • position: IPosition
    • Optional revealVerticalInCenter: boolean
    • Optional revealHorizontal: boolean

    Returns void

revealPositionInCenter

  • revealPositionInCenter(position: IPosition): void

revealPositionInCenterIfOutsideViewport

  • revealPositionInCenterIfOutsideViewport(position: IPosition): void

revealRange

  • revealRange(range: IRange): void

revealRangeAtTop

  • revealRangeAtTop(range: IRange): void

revealRangeInCenter

  • revealRangeInCenter(range: IRange): void

revealRangeInCenterIfOutsideViewport

  • revealRangeInCenterIfOutsideViewport(range: IRange): 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

setScrollLeft

  • setScrollLeft(newScrollLeft: number): void
  • Change the scrollLeft of the editor's viewport.

    Parameters

    • newScrollLeft: number

    Returns void

setScrollPosition

setScrollTop

  • setScrollTop(newScrollTop: number): void
  • Change the scrollTop of the editor's viewport.

    Parameters

    • newScrollTop: number

    Returns void

setSelection

  • setSelection(selection: IRange): void
  • setSelection(selection: Range): void
  • setSelection(selection: ISelection): void
  • setSelection(selection: Selection): void

setSelections

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

    Parameters

    • selections: ISelection[]

    Returns void

setValue

  • setValue(newValue: string): void
  • Set the value of the current model attached to this editor.

    see

    IModel.setValue

    Parameters

    • newValue: string

    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