Options
All
  • Public
  • Public/Protected
  • All
Menu

A widget that provides a code editor.

Hierarchy

Index

Properties

Readonly charWidth

charWidth: number

The widget of a character in the editor in pixels.

Readonly edgeRequested

edgeRequested: ISignal<IEditor, EdgeLocation>

A signal emitted when either the top or bottom edge is requested.

Readonly host

host: HTMLElement

The DOM node that hosts the editor.

Readonly isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

Readonly lineCount

lineCount: number

Get the number of lines in the editor.

Readonly lineHeight

lineHeight: number

The height of a line in the editor in pixels.

Readonly model

model: IModel

The model used by the editor.

selectionStyle

selectionStyle: ISelectionStyle

The default selection style for the editor.

uuid

uuid: string

The uuid of this selection owner.

Methods

addKeydownHandler

blur

  • blur(): void

clearHistory

  • clearHistory(): void

dispose

  • dispose(): void
  • Dispose of the resources held by the object.

    Notes

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

focus

  • focus(): void

getCoordinateForPosition

getCursorPosition

getLine

  • getLine(line: number): string
  • Returns the content for the given line number.

    Parameters

    • line: number

      The line of interest.

    Returns string

    The value of the line.

    Notes

    Lines are 0-based, and accessing a line out of range returns undefined.

getOffsetAt

  • Find an offset for the given position.

    Parameters

    • position: IPosition

      The position of interest.

    Returns number

    The offset at the position, clamped to the extent of the editor contents.

getOption

  • getOption<K>(option: K): IConfig[K]
  • Get a config option for the editor.

    Type parameters

    • K: "cursorBlinkRate" | "fontFamily" | "fontSize" | "lineHeight" | "lineNumbers" | "lineWrap" | "readOnly" | "tabSize" | "insertSpaces" | "matchBrackets" | "autoClosingBrackets" | "handlePaste" | "wordWrapColumn" | "rulers" | "codeFolding" | "showTrailingSpace"

    Parameters

    • option: K

    Returns IConfig[K]

getPositionAt

  • Find a position for the given offset.

    Parameters

    • offset: number

      The offset of interest.

    Returns IPosition

    The position at the offset, clamped to the extent of the editor contents.

getPositionForCoordinate

getSelection

getSelections

getTokenForPosition

getTokens

hasFocus

  • hasFocus(): boolean

newIndentedLine

  • newIndentedLine(): void

redo

  • redo(): void

refresh

  • refresh(): void

Optional replaceSelection

  • replaceSelection(text: string): void

resizeToFit

  • resizeToFit(): void

revealPosition

revealSelection

  • revealSelection(selection: IRange): void

setCursorPosition

  • setCursorPosition(position: IPosition): void

setOption

  • setOption<K>(option: K, value: IConfig[K]): void
  • Set a config option for the editor.

    Type parameters

    • K: "cursorBlinkRate" | "fontFamily" | "fontSize" | "lineHeight" | "lineNumbers" | "lineWrap" | "readOnly" | "tabSize" | "insertSpaces" | "matchBrackets" | "autoClosingBrackets" | "handlePaste" | "wordWrapColumn" | "rulers" | "codeFolding" | "showTrailingSpace"

    Parameters

    Returns void

setOptions

  • setOptions(options: Partial<IConfig>): void

setSelection

  • setSelection(selection: IRange): void

setSelections

  • setSelections(selections: IRange[]): void

setSize

undo

  • undo(): void

Generated using TypeDoc