Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace editor

Index

Enumerations

Classes

Interfaces

Type aliases

Events

Variables

Functions

Type aliases

BuiltinTheme

BuiltinTheme: "vs" | "vs-dark" | "hc-black"

ComputedEditorOptionValue

ComputedEditorOptionValue<T>: T extends IEditorOption<any, infer R> ? R : never

Type parameters

EditorAutoClosingOvertypeStrategy

EditorAutoClosingOvertypeStrategy: "always" | "auto" | "never"

Configuration options for typing over closing quotes or brackets

EditorAutoClosingStrategy

EditorAutoClosingStrategy: "always" | "languageDefined" | "beforeWhitespace" | "never"

Configuration options for auto closing quotes and brackets

EditorAutoSurroundStrategy

EditorAutoSurroundStrategy: "languageDefined" | "quotes" | "brackets" | "never"

Configuration options for auto wrapping quotes and brackets

EditorCommentsOptions

EditorCommentsOptions: Readonly<Required<IEditorCommentsOptions>>

EditorFindOptions

EditorFindOptions: Readonly<Required<IEditorFindOptions>>

EditorHoverOptions

EditorHoverOptions: Readonly<Required<IEditorHoverOptions>>

EditorInlineHintsOptions

EditorInlineHintsOptions: Readonly<Required<IEditorInlineHintsOptions>>

EditorLightbulbOptions

EditorLightbulbOptions: Readonly<Required<IEditorLightbulbOptions>>

EditorMinimapOptions

EditorMinimapOptions: Readonly<Required<IEditorMinimapOptions>>

EditorOptionsType

EditorOptionsType: typeof EditorOptions

FindComputedEditorOptionValueById

FindComputedEditorOptionValueById<T>: NonNullable<ComputedEditorOptionValue<EditorOptionsType[FindEditorOptionsKeyById<T>]>>

Type parameters

FindEditorOptionsKeyById

FindEditorOptionsKeyById<T>: {}[keyof EditorOptionsType]

Type parameters

GoToLocationOptions

GoToLocationOptions: Readonly<Required<IGotoLocationOptions>>

GoToLocationValues

GoToLocationValues: "peek" | "gotoAndPeek" | "goto"

IColors

IColors: {}

Type declaration

  • [colorId: string]: string

IEditorModel

IEditorViewState

An editor view state.

IModel

IModel: ITextModel

IReadOnlyModel

IReadOnlyModel: ITextModel

InternalParameterHintOptions

InternalParameterHintOptions: Readonly<Required<IEditorParameterHintOptions>>

InternalSuggestOptions

InternalSuggestOptions: Readonly<Required<ISuggestOptions>>

LineNumbersType

LineNumbersType: "on" | "off" | "relative" | "interval" | ((lineNumber: number) => string)

SmartSelectOptions

SmartSelectOptions: Readonly<Required<ISmartSelectOptions>>

ValidQuickSuggestionsOptions

ValidQuickSuggestionsOptions: boolean | Readonly<Required<IQuickSuggestionsOptions>>

Events

onDidChangeMarkers

  • onDidChangeMarkers(listener: (e: readonly Uri[]) => void): IDisposable
  • Emitted when markers change for a model.

    Parameters

    • listener: (e: readonly Uri[]) => void
        • (e: readonly Uri[]): void
        • Parameters

          • e: readonly Uri[]

          Returns void

    Returns IDisposable

onDidChangeModelLanguage

  • onDidChangeModelLanguage(listener: (e: { model: ITextModel; oldLanguage: string }) => void): IDisposable
  • Emitted when a different language is set to a model.

    Parameters

    • listener: (e: { model: ITextModel; oldLanguage: string }) => void
        • (e: { model: ITextModel; oldLanguage: string }): void
        • Parameters

          • e: { model: ITextModel; oldLanguage: string }
            • Readonly model: ITextModel
            • Readonly oldLanguage: string

          Returns void

    Returns IDisposable

onDidCreateEditor

  • Emitted when an editor is created. Creating a diff editor might cause this listener to be invoked with the two editors.

    Parameters

    Returns IDisposable

onDidCreateModel

  • Emitted when a model is created.

    Parameters

    Returns IDisposable

onWillDisposeModel

  • Emitted right before a model is disposed.

    Parameters

    Returns IDisposable

Variables

Const EditorOptions

EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption<acceptSuggestionOnCommitCharacter, boolean>; acceptSuggestionOnEnter: IEditorOption<acceptSuggestionOnEnter, "on" | "off" | "smart">; accessibilityPageSize: IEditorOption<accessibilityPageSize, number>; accessibilitySupport: IEditorOption<accessibilitySupport, AccessibilitySupport>; ariaLabel: IEditorOption<ariaLabel, string>; autoClosingBrackets: IEditorOption<autoClosingBrackets, EditorAutoClosingStrategy>; autoClosingOvertype: IEditorOption<autoClosingOvertype, EditorAutoClosingOvertypeStrategy>; autoClosingQuotes: IEditorOption<autoClosingQuotes, EditorAutoClosingStrategy>; autoIndent: IEditorOption<autoIndent, EditorAutoIndentStrategy>; autoSurround: IEditorOption<autoSurround, EditorAutoSurroundStrategy>; automaticLayout: IEditorOption<automaticLayout, boolean>; codeLens: IEditorOption<codeLens, boolean>; codeLensFontFamily: IEditorOption<codeLensFontFamily, string>; codeLensFontSize: IEditorOption<codeLensFontSize, number>; colorDecorators: IEditorOption<colorDecorators, boolean>; columnSelection: IEditorOption<columnSelection, boolean>; comments: IEditorOption<comments, EditorCommentsOptions>; contextmenu: IEditorOption<contextmenu, boolean>; copyWithSyntaxHighlighting: IEditorOption<copyWithSyntaxHighlighting, boolean>; cursorBlinking: IEditorOption<cursorBlinking, TextEditorCursorBlinkingStyle>; cursorSmoothCaretAnimation: IEditorOption<cursorSmoothCaretAnimation, boolean>; cursorStyle: IEditorOption<cursorStyle, TextEditorCursorStyle>; cursorSurroundingLines: IEditorOption<cursorSurroundingLines, number>; cursorSurroundingLinesStyle: IEditorOption<cursorSurroundingLinesStyle, "default" | "all">; cursorWidth: IEditorOption<cursorWidth, number>; definitionLinkOpensInPeek: IEditorOption<definitionLinkOpensInPeek, boolean>; disableLayerHinting: IEditorOption<disableLayerHinting, boolean>; disableMonospaceOptimizations: IEditorOption<disableMonospaceOptimizations, boolean>; dragAndDrop: IEditorOption<dragAndDrop, boolean>; editorClassName: IEditorOption<editorClassName, string>; emptySelectionClipboard: IEditorOption<emptySelectionClipboard, boolean>; extraEditorClassName: IEditorOption<extraEditorClassName, string>; fastScrollSensitivity: IEditorOption<fastScrollSensitivity, number>; find: IEditorOption<find, EditorFindOptions>; fixedOverflowWidgets: IEditorOption<fixedOverflowWidgets, boolean>; folding: IEditorOption<folding, boolean>; foldingHighlight: IEditorOption<foldingHighlight, boolean>; foldingStrategy: IEditorOption<foldingStrategy, "auto" | "indentation">; fontFamily: IEditorOption<fontFamily, string>; fontInfo: IEditorOption<fontInfo, FontInfo>; fontLigatures2: IEditorOption<fontLigatures, string>; fontSize: IEditorOption<fontSize, number>; fontWeight: IEditorOption<fontWeight, string>; formatOnPaste: IEditorOption<formatOnPaste, boolean>; formatOnType: IEditorOption<formatOnType, boolean>; glyphMargin: IEditorOption<glyphMargin, boolean>; gotoLocation: IEditorOption<gotoLocation, GoToLocationOptions>; hideCursorInOverviewRuler: IEditorOption<hideCursorInOverviewRuler, boolean>; highlightActiveIndentGuide: IEditorOption<highlightActiveIndentGuide, boolean>; hover: IEditorOption<hover, EditorHoverOptions>; inDiffEditor: IEditorOption<inDiffEditor, boolean>; inlineHints: IEditorOption<inlineHints, any>; layoutInfo: IEditorOption<layoutInfo, EditorLayoutInfo>; letterSpacing: IEditorOption<letterSpacing, number>; lightbulb: IEditorOption<lightbulb, EditorLightbulbOptions>; lineDecorationsWidth: IEditorOption<lineDecorationsWidth, string | number>; lineHeight: IEditorOption<lineHeight, number>; lineNumbers: IEditorOption<lineNumbers, InternalEditorRenderLineNumbersOptions>; lineNumbersMinChars: IEditorOption<lineNumbersMinChars, number>; linkedEditing: IEditorOption<linkedEditing, boolean>; links: IEditorOption<links, boolean>; matchBrackets: IEditorOption<matchBrackets, "always" | "never" | "near">; minimap: IEditorOption<minimap, EditorMinimapOptions>; mouseStyle: IEditorOption<mouseStyle, "default" | "text" | "copy">; mouseWheelScrollSensitivity: IEditorOption<mouseWheelScrollSensitivity, number>; mouseWheelZoom: IEditorOption<mouseWheelZoom, boolean>; multiCursorMergeOverlapping: IEditorOption<multiCursorMergeOverlapping, boolean>; multiCursorModifier: IEditorOption<multiCursorModifier, "altKey" | "metaKey" | "ctrlKey">; multiCursorPaste: IEditorOption<multiCursorPaste, "spread" | "full">; occurrencesHighlight: IEditorOption<occurrencesHighlight, boolean>; overviewRulerBorder: IEditorOption<overviewRulerBorder, boolean>; overviewRulerLanes: IEditorOption<overviewRulerLanes, number>; padding: IEditorOption<padding, InternalEditorPaddingOptions>; parameterHints: IEditorOption<parameterHints, InternalParameterHintOptions>; peekWidgetDefaultFocus: IEditorOption<peekWidgetDefaultFocus, "tree" | "editor">; pixelRatio: IEditorOption<pixelRatio, number>; quickSuggestions: IEditorOption<quickSuggestions, ValidQuickSuggestionsOptions>; quickSuggestionsDelay: IEditorOption<quickSuggestionsDelay, number>; readOnly: IEditorOption<readOnly, boolean>; renameOnType: IEditorOption<renameOnType, boolean>; renderControlCharacters: IEditorOption<renderControlCharacters, boolean>; renderFinalNewline: IEditorOption<renderFinalNewline, boolean>; renderIndentGuides: IEditorOption<renderIndentGuides, boolean>; renderLineHighlight: IEditorOption<renderLineHighlight, "all" | "line" | "none" | "gutter">; renderLineHighlightOnlyWhenFocus: IEditorOption<renderLineHighlightOnlyWhenFocus, boolean>; renderValidationDecorations: IEditorOption<renderValidationDecorations, "on" | "off" | "editable">; renderWhitespace: IEditorOption<renderWhitespace, "all" | "none" | "boundary" | "selection" | "trailing">; revealHorizontalRightPadding: IEditorOption<revealHorizontalRightPadding, number>; roundedSelection: IEditorOption<roundedSelection, boolean>; rulers: IEditorOption<rulers, {}>; scrollBeyondLastColumn: IEditorOption<scrollBeyondLastColumn, number>; scrollBeyondLastLine: IEditorOption<scrollBeyondLastLine, boolean>; scrollPredominantAxis: IEditorOption<scrollPredominantAxis, boolean>; scrollbar: IEditorOption<scrollbar, InternalEditorScrollbarOptions>; selectOnLineNumbers: IEditorOption<selectOnLineNumbers, boolean>; selectionClipboard: IEditorOption<selectionClipboard, boolean>; selectionHighlight: IEditorOption<selectionHighlight, boolean>; showDeprecated: IEditorOption<showDeprecated, boolean>; showFoldingControls: IEditorOption<showFoldingControls, "always" | "mouseover">; showUnused: IEditorOption<showUnused, boolean>; smartSelect: IEditorOption<smartSelect, any>; smoothScrolling: IEditorOption<smoothScrolling, boolean>; snippetSuggestions: IEditorOption<snippetSuggestions, "none" | "top" | "bottom" | "inline">; stickyTabStops: IEditorOption<stickyTabStops, boolean>; stopRenderingLineAfter: IEditorOption<stopRenderingLineAfter, number>; suggest: IEditorOption<suggest, InternalSuggestOptions>; suggestFontSize: IEditorOption<suggestFontSize, number>; suggestLineHeight: IEditorOption<suggestLineHeight, number>; suggestOnTriggerCharacters: IEditorOption<suggestOnTriggerCharacters, boolean>; suggestSelection: IEditorOption<suggestSelection, "first" | "recentlyUsed" | "recentlyUsedByPrefix">; tabCompletion: IEditorOption<tabCompletion, "on" | "off" | "onlySnippets">; tabFocusMode: IEditorOption<tabFocusMode, boolean>; tabIndex: IEditorOption<tabIndex, number>; unfoldOnClickAfterEndOfLine: IEditorOption<unfoldOnClickAfterEndOfLine, boolean>; unusualLineTerminators: IEditorOption<unusualLineTerminators, "auto" | "off" | "prompt">; useTabStops: IEditorOption<useTabStops, boolean>; wordSeparators: IEditorOption<wordSeparators, string>; wordWrap: IEditorOption<wordWrap, "on" | "off" | "wordWrapColumn" | "bounded">; wordWrapBreakAfterCharacters: IEditorOption<wordWrapBreakAfterCharacters, string>; wordWrapBreakBeforeCharacters: IEditorOption<wordWrapBreakBeforeCharacters, string>; wordWrapColumn: IEditorOption<wordWrapColumn, number>; wordWrapOverride1: IEditorOption<wordWrapOverride1, "on" | "off" | "inherit">; wordWrapOverride2: IEditorOption<wordWrapOverride2, "on" | "off" | "inherit">; wrappingIndent: IEditorOption<wrappingIndent, WrappingIndent>; wrappingInfo: IEditorOption<wrappingInfo, EditorWrappingInfo>; wrappingStrategy: IEditorOption<wrappingStrategy, "simple" | "advanced"> }

Type declaration

Const EditorType

EditorType: { ICodeEditor: string; IDiffEditor: string }

The type of the IEditor.

Type declaration

  • ICodeEditor: string
  • IDiffEditor: string

Functions

colorize

  • colorize(text: string, languageId: string, options: IColorizerOptions): Promise<string>
  • Colorize text using language languageId.

    Parameters

    Returns Promise<string>

colorizeElement

  • Colorize the contents of domNode using attribute data-lang.

    Parameters

    Returns Promise<void>

colorizeModelLine

  • colorizeModelLine(model: ITextModel, lineNumber: number, tabSize?: number): string
  • Colorize a line in a model.

    Parameters

    • model: ITextModel
    • lineNumber: number
    • Optional tabSize: number

    Returns string

create

createDiffEditor

createDiffNavigator

createModel

  • createModel(value: string, language?: string, uri?: Uri): ITextModel
  • Create a new editor model. You can specify the language that should be set for this model or let the language be inferred from the uri.

    Parameters

    • value: string
    • Optional language: string
    • Optional uri: Uri

    Returns ITextModel

createWebWorker

  • Create a new web worker that has model syncing capabilities built in. Specify an AMD module to load that will create an object that will be proxied.

    Type parameters

    • T

    Parameters

    Returns MonacoWebWorker<T>

defineTheme

  • Define a new theme or update an existing theme.

    Parameters

    Returns void

getModel

  • Get the model that has uri if it exists.

    Parameters

    Returns ITextModel | null

getModelMarkers

  • getModelMarkers(filter: { owner?: string; resource?: Uri; take?: number }): IMarker[]
  • Get markers for owner and/or resource

    Parameters

    • filter: { owner?: string; resource?: Uri; take?: number }
      • Optional owner?: string
      • Optional resource?: Uri
      • Optional take?: number

    Returns IMarker[]

    list of markers

getModels

  • Get all the created models.

    Returns ITextModel[]

registerCommand

  • registerCommand(id: string, handler: (accessor: any, ...args: any[]) => void): IDisposable
  • Register a command.

    Parameters

    • id: string
    • handler: (accessor: any, ...args: any[]) => void
        • (accessor: any, ...args: any[]): void
        • Parameters

          • accessor: any
          • Rest ...args: any[]

          Returns void

    Returns IDisposable

remeasureFonts

  • remeasureFonts(): void
  • Clears all cached font measurements and triggers re-measurement.

    Returns void

setModelLanguage

  • setModelLanguage(model: ITextModel, languageId: string): void
  • Change the language for a model.

    Parameters

    Returns void

setModelMarkers

  • Set the markers for a model.

    Parameters

    Returns void

setTheme

  • setTheme(themeName: string): void
  • Switches to a theme.

    Parameters

    • themeName: string

    Returns void

tokenize

  • tokenize(text: string, languageId: string): Token[][]
  • Tokenize text using language languageId

    Parameters

    • text: string
    • languageId: string

    Returns Token[][]

Generated using TypeDoc