Hierarchy

Index

Events

Methods

Events

onContextMenu

onDidBlurEditorText

onDidBlurEditorWidget

  • onDidBlurEditorWidget(listener: function): 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

onDidChangeModelLanguageConfiguration

  • onDidChangeModelLanguageConfiguration(listener: function): IDisposable

onDidChangeModelOptions

  • onDidChangeModelOptions(listener: function): IDisposable

onDidDispose

onDidFocusEditorText

  • onDidFocusEditorText(listener: function): IDisposable

onDidFocusEditorWidget

  • onDidFocusEditorWidget(listener: function): IDisposable

onDidLayoutChange

onDidPaste

onDidScrollChange

onKeyDown

onKeyUp

onMouseDown

onMouseLeave

onMouseMove

onMouseUp

Methods

addAction

addCommand

  • addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null

addContentWidget

addOverlayWidget

applyFontInfo

changeViewZones

  • changeViewZones(callback: function): void

createContextKey

  • createContextKey<T>(key: string, defaultValue: T): IContextKey<T>

deltaDecorations

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

    see

    ITextModel.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 (concomitant) commands on the editor.

    Parameters

    • source: string

      The source of the call.

    • commands: ICommand[]

    Returns void

executeEdits

  • executeEdits(source: string, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | 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 endCursorState: ICursorStateComputer | 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.

getContribution

  • getContribution<T>(id: string): T

getDomNode

getEditorType

  • getEditorType(): string

getId

  • getId(): string

getLayoutInfo

getLineDecorations

  • getLineDecorations(lineNumber: number): IModelDecoration[] | null

getModel

getOffsetForColumn

  • getOffsetForColumn(lineNumber: number, column: number): number
  • Get the horizontal position (left offset) for the column w.r.t to the beginning of the line. This method works only if the line lineNumber is currently rendered (in the editor's viewport). Use this method with caution.

    Parameters

    • lineNumber: number
    • column: number

    Returns number

getPosition

getRawOptions

getScrollHeight

  • getScrollHeight(): number

getScrollLeft

  • getScrollLeft(): number

getScrollTop

  • getScrollTop(): number

getScrollWidth

  • getScrollWidth(): number

getScrolledVisiblePosition

  • getScrolledVisiblePosition(position: IPosition): object | null
  • Get the visible position for position. The result position takes scrolling into account and is relative to the top left corner of the editor. Explanation 1: the results of this method will change for the same position if the user scrolls the editor. Explanation 2: the results of this method will not change if the container of the editor gets repositioned. Warning: the results of this method are inaccurate for positions that are outside the current editor viewport.

    Parameters

    Returns object | null

getSelection

getSelections

  • getSelections(): Selection[] | null

getSupportedActions

  • getSupportedActions(): IEditorAction[]

getTargetAtClientPoint

  • getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null
  • Get the hit test target at coordinates clientX and clientY. The coordinates are relative to the top-left of the viewport.

    Parameters

    • clientX: number
    • clientY: number

    Returns IMouseTarget | null

    Hit test target or null if the coordinates fall outside the editor or the editor has no model.

getTopForLineNumber

  • getTopForLineNumber(lineNumber: number): number

getTopForPosition

  • getTopForPosition(lineNumber: number, column: number): number

getValue

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

    see

    ITextModel.getValue

    Parameters

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

    Returns string

getVisibleColumnFromPosition

  • getVisibleColumnFromPosition(position: IPosition): number

getVisibleRanges

  • getVisibleRanges(): Range[]

hasTextFocus

  • hasTextFocus(): boolean

hasWidgetFocus

  • hasWidgetFocus(): 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

layoutContentWidget

layoutOverlayWidget

onCompositionEnd

onCompositionStart

pushUndoStop

  • pushUndoStop(): boolean

removeContentWidget

removeOverlayWidget

render

  • render(forceRedraw?: boolean): void

restoreViewState

revealLine

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

revealLineInCenter

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

revealLineInCenterIfOutsideViewport

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

revealLines

  • revealLines(startLineNumber: number, endLineNumber: number, scrollType?: ScrollType): void

revealLinesInCenter

  • revealLinesInCenter(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void

revealLinesInCenterIfOutsideViewport

  • revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void

revealPosition

revealPositionInCenter

revealPositionInCenterIfOutsideViewport

revealRange

revealRangeAtTop

revealRangeInCenter

revealRangeInCenterIfOutsideViewport

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

setScrollPosition

setScrollTop

  • setScrollTop(newScrollTop: number): void

setSelection

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

setSelections

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

    Parameters

    • selections: keyof ISelection[]

    Returns void

setValue

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

    see

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