Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Events

Properties

Methods

Events

onContextMenu: IEvent<IEditorMouseEvent>

An event emitted on a "contextmenu".

onDidAttemptReadOnlyEdit: IEvent<void>

An event emitted when editing failed because the editor is read-only.

onDidBlurEditorText: IEvent<void>

An event emitted when the text inside this editor lost focus (i.e. cursor stops blinking).

onDidBlurEditorWidget: IEvent<void>

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

onDidChangeConfiguration: IEvent<ConfigurationChangedEvent>

An event emitted when the configuration of the editor has changed. (e.g. editor.updateOptions())

onDidChangeCursorPosition: IEvent<ICursorPositionChangedEvent>

An event emitted when the cursor position has changed.

onDidChangeCursorSelection: IEvent<ICursorSelectionChangedEvent>

An event emitted when the cursor selection has changed.

onDidChangeHiddenAreas: IEvent<void>

An event emitted when hidden areas change in the editor (e.g. due to folding).

onDidChangeModel: IEvent<IModelChangedEvent>

An event emitted when the model of this editor has changed (e.g. editor.setModel()).

onDidChangeModelContent: IEvent<IModelContentChangedEvent>

An event emitted when the content of the current model has changed.

onDidChangeModelDecorations: IEvent<IModelDecorationsChangedEvent>

An event emitted when the decorations of the current model have changed.

onDidChangeModelLanguage: IEvent<IModelLanguageChangedEvent>

An event emitted when the language of the current model has changed.

onDidChangeModelLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>

An event emitted when the language configuration of the current model has changed.

onDidChangeModelOptions: IEvent<IModelOptionsChangedEvent>

An event emitted when the options of the current model has changed.

onDidContentSizeChange: IEvent<IContentSizeChangedEvent>

An event emitted when the content width or content height in the editor has changed.

onDidFocusEditorText: IEvent<void>

An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking).

onDidFocusEditorWidget: IEvent<void>

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

onDidLayoutChange: IEvent<EditorLayoutInfo>

An event emitted when the layout of the editor has changed.

onDidPaste: IEvent<IPasteEvent>

An event emitted when users paste text in the editor.

onDidScrollChange: IEvent<IScrollEvent>

An event emitted when the scroll in the editor has changed.

An event emitted on a "keydown".

An event emitted on a "keyup".

An event emitted on a "mousedown".

An event emitted on a "mouseleave".

An event emitted on a "mousemove".

An event emitted on a "mouseup".

Properties

onDidCompositionEnd: IEvent<void>

An event emitted after composition has ended.

onDidCompositionStart: IEvent<void>

An event emitted after composition has started.

Methods

  • addCommand(keybinding: number, handler: ICommandHandler, context?: string): string
  • applyFontInfo(target: HTMLElement): void
  • createContextKey<T>(key: string, defaultValue: T): IContextKey<T>
  • dispose(): void
  • executeCommand(source: string, command: ICommand): void
  • executeCommands(source: string, commands: ICommand[]): void
  • focus(): void
  • getContainerDomNode(): HTMLElement
  • getContentHeight(): number
  • getContentWidth(): number
  • getContribution<T>(id: string): T
  • getDomNode(): HTMLElement
  • getEditorType(): string
  • getId(): string
  • 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

  • getScrollHeight(): number
  • getScrollLeft(): number
  • getScrollTop(): number
  • getScrollWidth(): number
  • getScrolledVisiblePosition(position: IPosition): { height: number; left: number; top: number }
  • 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 { height: number; left: number; top: number }

    • height: number
    • left: number
    • top: number
  • getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget
  • getTopForLineNumber(lineNumber: number): number
  • getTopForPosition(lineNumber: number, column: number): number
  • getValue(options?: { lineEnding: string; preserveBOM: boolean }): string
  • getVisibleColumnFromPosition(position: IPosition): number
  • getVisibleRanges(): Range[]
  • hasTextFocus(): boolean
  • hasWidgetFocus(): boolean
  • 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

  • popUndoStop(): boolean
  • pushUndoStop(): boolean
  • removeDecorations(decorationIds: string[]): void
  • render(forceRedraw?: boolean): 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
  • revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void
  • revealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void
  • setBanner(bannerDomNode: HTMLElement, height: number): 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

  • setPosition(position: IPosition, source?: string): void
  • setScrollLeft(newScrollLeft: number, scrollType?: ScrollType): void
  • setScrollTop(newScrollTop: number, scrollType?: ScrollType): 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
  • setValue(newValue: string): void
  • 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