monaco-editor-core
- Version 0.52.2
- Published
- 61 MB
- No dependencies
- MIT license
Install
npm i monaco-editor-core
yarn add monaco-editor-core
pnpm add monaco-editor-core
Overview
A browser based code editor
Index
Classes
Range
- areIntersecting()
- areIntersectingOrTouching()
- collapseToEnd()
- collapseToStart()
- compareRangesUsingEnds()
- compareRangesUsingStarts()
- containsPosition()
- containsRange()
- delta()
- endColumn
- endLineNumber
- equalsRange()
- fromPositions()
- getEndPosition()
- getStartPosition()
- intersectRanges()
- isEmpty()
- isIRange()
- lift()
- plusRange()
- setEndPosition()
- setStartPosition()
- spansMultipleLines()
- startColumn
- startLineNumber
- strictContainsRange()
- toJSON()
- toString()
Interfaces
Enums
KeyCode
- ABNT_C1
- ABNT_C2
- Alt
- AudioVolumeDown
- AudioVolumeMute
- AudioVolumeUp
- Backquote
- Backslash
- Backspace
- BracketLeft
- BracketRight
- BrowserBack
- BrowserForward
- BrowserHome
- BrowserSearch
- CapsLock
- Clear
- Comma
- ContextMenu
- Ctrl
- Delete
- DependsOnKbLayout
- Digit0
- Digit1
- Digit2
- Digit3
- Digit4
- Digit5
- Digit6
- Digit7
- Digit8
- Digit9
- DownArrow
- End
- Enter
- Equal
- Escape
- F1
- F10
- F11
- F12
- F13
- F14
- F15
- F16
- F17
- F18
- F19
- F2
- F20
- F21
- F22
- F23
- F24
- F3
- F4
- F5
- F6
- F7
- F8
- F9
- Home
- Insert
- IntlBackslash
- KEY_IN_COMPOSITION
- KeyA
- KeyB
- KeyC
- KeyD
- KeyE
- KeyF
- KeyG
- KeyH
- KeyI
- KeyJ
- KeyK
- KeyL
- KeyM
- KeyN
- KeyO
- KeyP
- KeyQ
- KeyR
- KeyS
- KeyT
- KeyU
- KeyV
- KeyW
- KeyX
- KeyY
- KeyZ
- LaunchApp2
- LaunchMail
- LaunchMediaPlayer
- LeftArrow
- MAX_VALUE
- MediaPlayPause
- MediaStop
- MediaTrackNext
- MediaTrackPrevious
- Meta
- Minus
- NumLock
- NUMPAD_SEPARATOR
- Numpad0
- Numpad1
- Numpad2
- Numpad3
- Numpad4
- Numpad5
- Numpad6
- Numpad7
- Numpad8
- Numpad9
- NumpadAdd
- NumpadDecimal
- NumpadDivide
- NumpadMultiply
- NumpadSubtract
- OEM_8
- PageDown
- PageUp
- PauseBreak
- Period
- Quote
- RightArrow
- ScrollLock
- Semicolon
- Shift
- Slash
- Space
- Tab
- Unknown
- UpArrow
Type Aliases
Namespaces
editor
- AccessibilitySupport
- addCommand()
- addEditorAction()
- addKeybindingRule()
- addKeybindingRules()
- ApplyUpdateResult
- BareFontInfo
- BracketPairColorizationOptions
- BuiltinTheme
- colorize()
- colorizeElement()
- colorizeModelLine()
- ComputedEditorOptionValue
- ConfigurationChangedEvent
- ContentWidgetPositionPreference
- ContextKeyValue
- create()
- createDiffEditor()
- createModel()
- createMultiFileDiffEditor()
- createWebWorker()
- CursorChangeReason
- DefaultEndOfLine
- defineTheme()
- EditorAutoClosingEditStrategy
- EditorAutoClosingStrategy
- EditorAutoIndentStrategy
- EditorAutoSurroundStrategy
- EditorLayoutInfo
- EditorMinimapLayoutInfo
- EditorOption
- EditorOptions
- EditorOptionsType
- EditorType
- EditorWrappingInfo
- EditorZoom
- EndOfLinePreference
- EndOfLineSequence
- FindComputedEditorOptionValueById
- FindEditorOptionsKeyById
- FindMatch
- FontInfo
- getDiffEditors()
- getEditors()
- getModel()
- getModelMarkers()
- getModels()
- GlyphMarginLane
- GoToLocationValues
- IActionDescriptor
- IBaseMouseTarget
- IBracketPairColorizationOptions
- IChange
- ICharChange
- ICodeEditor
- ICodeEditorOpener
- ICodeEditorViewState
- IColorizerElementOptions
- IColorizerOptions
- IColors
- ICommand
- ICommandDescriptor
- ICommandHandler
- ICommandMetadata
- IComputedEditorOptions
- IContentSizeChangedEvent
- IContentWidget
- IContentWidgetPosition
- IContextKey
- ICursorPositionChangedEvent
- ICursorSelectionChangedEvent
- ICursorState
- ICursorStateComputer
- ICursorStateComputerData
- IDecorationOptions
- IDiffEditor
- IDiffEditorBaseOptions
- IDiffEditorConstructionOptions
- IDiffEditorModel
- IDiffEditorOptions
- IDiffEditorViewModel
- IDiffEditorViewState
- IDimension
- IDropIntoEditorOptions
- IEditOperationBuilder
- IEditor
- IEditorAction
- IEditorCommentsOptions
- IEditorConstructionOptions
- IEditorContribution
- IEditorDecorationsCollection
- IEditorFindOptions
- IEditorHoverOptions
- IEditorInlayHintsOptions
- IEditorLightbulbOptions
- IEditorMinimapOptions
- IEditorModel
- IEditorMouseEvent
- IEditorOption
- IEditorOptions
- IEditorOverrideServices
- IEditorPaddingOptions
- IEditorParameterHintOptions
- IEditorScrollbarOptions
- IEditorStickyScrollOptions
- IEditorViewState
- IEditorZoom
- IGlobalEditorOptions
- IGlyphMarginLanesModel
- IGlyphMarginWidget
- IGlyphMarginWidgetPosition
- IGotoLocationOptions
- IGuidesOptions
- IIdentifiedSingleEditOperation
- IInlineEditOptions
- IInlineSuggestOptions
- IKeybindingRule
- ILineChange
- ILinkOpener
- ILocalizedString
- IMarker
- IMarkerData
- IModel
- IModelChangedEvent
- IModelContentChange
- IModelContentChangedEvent
- IModelDecoration
- IModelDecorationGlyphMarginOptions
- IModelDecorationMinimapOptions
- IModelDecorationOptions
- IModelDecorationOverviewRulerOptions
- IModelDecorationsChangedEvent
- IModelDeltaDecoration
- IModelLanguageChangedEvent
- IModelLanguageConfigurationChangedEvent
- IModelOptionsChangedEvent
- IMouseTarget
- IMouseTargetContentEmpty
- IMouseTargetContentEmptyData
- IMouseTargetContentText
- IMouseTargetContentTextData
- IMouseTargetContentWidget
- IMouseTargetMargin
- IMouseTargetMarginData
- IMouseTargetOutsideEditor
- IMouseTargetOverlayWidget
- IMouseTargetOverviewRuler
- IMouseTargetScrollbar
- IMouseTargetTextarea
- IMouseTargetUnknown
- IMouseTargetViewZone
- IMouseTargetViewZoneData
- INewScrollPosition
- InjectedTextCursorStops
- InjectedTextOptions
- InternalEditorRenderLineNumbersOptions
- InternalEditorScrollbarOptions
- InternalQuickSuggestionsOptions
- InUntrustedWorkspace
- IOverlayWidget
- IOverlayWidgetPosition
- IOverlayWidgetPositionCoordinates
- IPartialEditorMouseEvent
- IPasteAsOptions
- IPasteEvent
- IQuickSuggestionsOptions
- IReadOnlyModel
- IRelatedInformation
- IRulerOption
- ISingleEditOperation
- ISmartSelectOptions
- IStandaloneCodeEditor
- IStandaloneDiffEditor
- IStandaloneDiffEditorConstructionOptions
- IStandaloneEditorConstructionOptions
- IStandaloneThemeData
- ISuggestOptions
- ITextModel
- ITextModelUpdateOptions
- ITextSnapshot
- ITokenThemeRule
- IUnicodeHighlightOptions
- IValidEditOperation
- IViewState
- IViewZone
- IViewZoneChangeAccessor
- IWebWorkerOptions
- IWordAtPosition
- LineNumbersType
- MinimapPosition
- MinimapSectionHeaderStyle
- MonacoWebWorker
- MouseTargetType
- onDidChangeMarkers()
- onDidChangeModelLanguage()
- onDidCreateDiffEditor()
- onDidCreateEditor()
- onDidCreateModel()
- onWillDisposeModel()
- OverlayWidgetPositionPreference
- OverviewRulerLane
- OverviewRulerPosition
- PositionAffinity
- QuickSuggestionsValue
- registerCommand()
- registerEditorOpener()
- registerLinkOpener()
- remeasureFonts()
- removeAllMarkers()
- RenderLineNumbersType
- RenderMinimap
- ScrollbarVisibility
- ScrollType
- setModelLanguage()
- setModelMarkers()
- setTheme()
- ShowLightbulbIconMode
- TextEditorCursorBlinkingStyle
- TextEditorCursorStyle
- TextModelResolvedOptions
- ThemeColor
- tokenize()
- TrackedRangeStickiness
- WrappingIndent
languages
- CharacterPair
- CodeAction
- CodeActionContext
- CodeActionList
- CodeActionProvider
- CodeActionProviderMetadata
- CodeActionTriggerType
- CodeLens
- CodeLensList
- CodeLensProvider
- Command
- CommentAuthorInformation
- CommentRule
- CommentThreadRevealOptions
- CompletionContext
- CompletionItem
- CompletionItemInsertTextRule
- CompletionItemKind
- CompletionItemLabel
- CompletionItemProvider
- CompletionItemRanges
- CompletionItemTag
- CompletionList
- CompletionTriggerKind
- DeclarationProvider
- Definition
- DefinitionProvider
- DocumentColorProvider
- DocumentContextItem
- DocumentFormattingEditProvider
- DocumentHighlight
- DocumentHighlightKind
- DocumentHighlightProvider
- DocumentRangeFormattingEditProvider
- DocumentRangeSemanticTokensProvider
- DocumentSemanticTokensProvider
- DocumentSymbol
- DocumentSymbolProvider
- EncodedTokensProvider
- EnterAction
- FoldingContext
- FoldingMarkers
- FoldingRange
- FoldingRangeKind
- FoldingRangeProvider
- FoldingRules
- FormattingOptions
- getEncodedLanguageId()
- getLanguages()
- Hover
- HoverContext
- HoverProvider
- HoverVerbosityAction
- HoverVerbosityRequest
- IAutoClosingPair
- IAutoClosingPairConditional
- IColor
- IColorInformation
- IColorPresentation
- IDocComment
- IEncodedLineTokens
- IExpandedMonarchLanguageAction
- IExpandedMonarchLanguageRule
- IInlineEdit
- IInlineEditContext
- ILanguageExtensionPoint
- ILineTokens
- ILink
- ILinksList
- IMonarchLanguage
- IMonarchLanguageAction
- IMonarchLanguageBracket
- IMonarchLanguageRule
- ImplementationProvider
- IndentAction
- IndentationRule
- InlayHint
- InlayHintKind
- InlayHintLabelPart
- InlayHintList
- InlayHintsProvider
- InlineCompletion
- InlineCompletionContext
- InlineCompletionProviderGroupId
- InlineCompletions
- InlineCompletionsProvider
- InlineCompletionTriggerKind
- InlineEditProvider
- InlineEditTriggerKind
- IRelativePattern
- IShortMonarchLanguageAction
- IShortMonarchLanguageRule1
- IShortMonarchLanguageRule2
- IState
- IToken
- IWorkspaceFileEdit
- IWorkspaceTextEdit
- LanguageConfiguration
- LanguageFilter
- LanguageSelector
- LinkedEditingRangeProvider
- LinkedEditingRanges
- LinkProvider
- Location
- LocationLink
- MappedEditsContext
- MappedEditsProvider
- MultiDocumentHighlight
- MultiDocumentHighlightProvider
- NewSymbolName
- NewSymbolNamesProvider
- NewSymbolNameTag
- NewSymbolNameTriggerKind
- OnEnterRule
- onLanguage()
- onLanguageEncountered()
- OnTypeFormattingEditProvider
- ParameterInformation
- PartialAcceptInfo
- PartialAcceptTriggerKind
- PendingCommentThread
- ProviderResult
- ReferenceContext
- ReferenceProvider
- register()
- registerCodeActionProvider()
- registerCodeLensProvider()
- registerColorProvider()
- registerCompletionItemProvider()
- registerDeclarationProvider()
- registerDefinitionProvider()
- registerDocumentFormattingEditProvider()
- registerDocumentHighlightProvider()
- registerDocumentRangeFormattingEditProvider()
- registerDocumentRangeSemanticTokensProvider()
- registerDocumentSemanticTokensProvider()
- registerDocumentSymbolProvider()
- registerFoldingRangeProvider()
- registerHoverProvider()
- registerImplementationProvider()
- registerInlayHintsProvider()
- registerInlineCompletionsProvider()
- registerInlineEditProvider()
- registerLinkedEditingRangeProvider()
- registerLinkProvider()
- registerNewSymbolNameProvider()
- registerOnTypeFormattingEditProvider()
- registerReferenceProvider()
- registerRenameProvider()
- registerSelectionRangeProvider()
- registerSignatureHelpProvider()
- registerTokensProviderFactory()
- registerTypeDefinitionProvider()
- Rejection
- RenameLocation
- RenameProvider
- SelectedSuggestionInfo
- SelectionRange
- SelectionRangeProvider
- SemanticTokens
- SemanticTokensEdit
- SemanticTokensEdits
- SemanticTokensLegend
- setColorMap()
- setLanguageConfiguration()
- setMonarchTokensProvider()
- setTokensProvider()
- SignatureHelp
- SignatureHelpContext
- SignatureHelpProvider
- SignatureHelpResult
- SignatureHelpTriggerKind
- SignatureInformation
- SymbolKind
- SymbolTag
- TextEdit
- TokensProvider
- TokensProviderFactory
- TypeDefinitionProvider
- WorkspaceEdit
- WorkspaceEditMetadata
- WorkspaceFileEditOptions
Classes
class CancellationTokenSource
class CancellationTokenSource {}
constructor
constructor(parent?: CancellationToken);
property token
readonly token: CancellationToken;
method cancel
cancel: () => void;
method dispose
dispose: (cancel?: boolean) => void;
class Emitter
class Emitter<T> {}
A helper that allows to emit and listen to typed events
constructor
constructor();
property event
readonly event: IEvent<T>;
method dispose
dispose: () => void;
method fire
fire: (event: T) => void;
class KeyMod
class KeyMod {}
class Position
class Position {}
A position in the editor.
constructor
constructor(lineNumber: number, column: number);
property column
readonly column: number;
column (the first character in a line is between column 1 and column 2)
property lineNumber
readonly lineNumber: number;
line number (starts at 1)
method clone
clone: () => Position;
Clone this position.
method compare
static compare: (a: IPosition, b: IPosition) => number;
A function that compares positions, useful for sorting
method delta
delta: (deltaLineNumber?: number, deltaColumn?: number) => Position;
Derive a new position from this position.
Parameter deltaLineNumber
line number delta
Parameter deltaColumn
column delta
method equals
static equals: (a: IPosition | null, b: IPosition | null) => boolean;
Test if this position equals other position
Test if position
a
equals positionb
method isBefore
static isBefore: (a: IPosition, b: IPosition) => boolean;
Test if this position is before other position. If the two positions are equal, the result will be false.
Test if position
a
is before positionb
. If the two positions are equal, the result will be false.
method isBeforeOrEqual
static isBeforeOrEqual: (a: IPosition, b: IPosition) => boolean;
Test if this position is before other position. If the two positions are equal, the result will be true.
Test if position
a
is before positionb
. If the two positions are equal, the result will be true.
method isIPosition
static isIPosition: (obj: any) => obj is IPosition;
Test if
obj
is anIPosition
.
method lift
static lift: (pos: IPosition) => Position;
Create a
Position
from anIPosition
.
method toJSON
toJSON: () => IPosition;
method toString
toString: () => string;
Convert to a human-readable representation.
method with
with: (newLineNumber?: number, newColumn?: number) => Position;
Create a new position from this position.
Parameter newLineNumber
new line number
Parameter newColumn
new column
class Range
class Range {}
A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)
constructor
constructor( startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number);
property endColumn
readonly endColumn: number;
Column on which the range ends in line
endLineNumber
.
property endLineNumber
readonly endLineNumber: number;
Line number on which the range ends.
property startColumn
readonly startColumn: number;
Column on which the range starts in line
startLineNumber
(starts at 1).
property startLineNumber
readonly startLineNumber: number;
Line number on which the range starts (starts at 1).
method areIntersecting
static areIntersecting: (a: IRange, b: IRange) => boolean;
Test if the two ranges are intersecting. If the ranges are touching it returns true.
method areIntersectingOrTouching
static areIntersectingOrTouching: (a: IRange, b: IRange) => boolean;
Test if the two ranges are touching in any way.
method collapseToEnd
static collapseToEnd: (range: IRange) => Range;
Create a new empty range using this range's end position.
method collapseToStart
static collapseToStart: (range: IRange) => Range;
Create a new empty range using this range's start position.
method compareRangesUsingEnds
static compareRangesUsingEnds: (a: IRange, b: IRange) => number;
A function that compares ranges, useful for sorting ranges It will first compare ranges on the endPosition and then on the startPosition
method compareRangesUsingStarts
static compareRangesUsingStarts: ( a: IRange | null | undefined, b: IRange | null | undefined) => number;
A function that compares ranges, useful for sorting ranges It will first compare ranges on the startPosition and then on the endPosition
method containsPosition
static containsPosition: (range: IRange, position: IPosition) => boolean;
Test if position is in this range. If the position is at the edges, will return true.
Test if
position
is inrange
. If the position is at the edges, will return true.
method containsRange
static containsRange: (range: IRange, otherRange: IRange) => boolean;
Test if range is in this range. If the range is equal to this range, will return true.
Test if
otherRange
is inrange
. If the ranges are equal, will return true.
method delta
delta: (lineCount: number) => Range;
Moves the range by the given amount of lines.
method equalsRange
static equalsRange: ( a: IRange | null | undefined, b: IRange | null | undefined) => boolean;
Test if this range equals other.
Test if range
a
equalsb
.
method fromPositions
static fromPositions: (start: IPosition, end?: IPosition) => Range;
method getEndPosition
static getEndPosition: (range: IRange) => Position;
Return the end position (which will be after or equal to the start position)
method getStartPosition
static getStartPosition: (range: IRange) => Position;
Return the start position (which will be before or equal to the end position)
method intersectRanges
static intersectRanges: (a: IRange, b: IRange) => Range | null;
A intersection of the two ranges.
method isEmpty
static isEmpty: (range: IRange) => boolean;
Test if this range is empty.
Test if
range
is empty.
method isIRange
static isIRange: (obj: any) => obj is IRange;
Test if
obj
is anIRange
.
method lift
static lift: { (range: undefined | null): null; (range: IRange): Range; (range: IRange): Range;};
Create a
Range
from anIRange
.
method plusRange
static plusRange: (a: IRange, b: IRange) => Range;
A reunion of the two ranges. The smallest position will be used as the start point, and the largest one as the end point.
method setEndPosition
setEndPosition: (endLineNumber: number, endColumn: number) => Range;
Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.
method setStartPosition
setStartPosition: (startLineNumber: number, startColumn: number) => Range;
Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.
method spansMultipleLines
static spansMultipleLines: (range: IRange) => boolean;
Test if the range spans multiple lines.
method strictContainsRange
static strictContainsRange: (range: IRange, otherRange: IRange) => boolean;
Test if
range
is strictly in this range.range
must start after and end before this range for the result to be true.Test if
otherRange
is strictly inrange
(must start after, and end before). If the ranges are equal, will return false.
method toJSON
toJSON: () => IRange;
method toString
toString: () => string;
Transform to a user presentable string representation.
class Selection
class Selection extends Range {}
A selection in the editor. The selection is a range that has an orientation.
constructor
constructor( selectionStartLineNumber: number, selectionStartColumn: number, positionLineNumber: number, positionColumn: number);
property positionColumn
readonly positionColumn: number;
The column on
positionLineNumber
where the selection has ended.
property positionLineNumber
readonly positionLineNumber: number;
The line number on which the selection has ended.
property selectionStartColumn
readonly selectionStartColumn: number;
The column on
selectionStartLineNumber
where the selection has started.
property selectionStartLineNumber
readonly selectionStartLineNumber: number;
The line number on which the selection has started.
method createWithDirection
static createWithDirection: ( startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number, direction: SelectionDirection) => Selection;
Create with a direction.
method equalsSelection
equalsSelection: (other: ISelection) => boolean;
Test if equals other selection.
method fromPositions
static fromPositions: (start: IPosition, end?: IPosition) => Selection;
Create a
Selection
from one or two positions
method fromRange
static fromRange: (range: Range, direction: SelectionDirection) => Selection;
Creates a
Selection
from a range, given a direction.
method getDirection
getDirection: () => SelectionDirection;
Get directions (LTR or RTL).
method getPosition
getPosition: () => Position;
Get the position at
positionLineNumber
andpositionColumn
.
method getSelectionStart
getSelectionStart: () => Position;
Get the position at the start of the selection.
method isISelection
static isISelection: (obj: any) => obj is ISelection;
Test if
obj
is anISelection
.
method liftSelection
static liftSelection: (sel: ISelection) => Selection;
Create a
Selection
from anISelection
.
method selectionsArrEqual
static selectionsArrEqual: (a: ISelection[], b: ISelection[]) => boolean;
a
equalsb
.
method selectionsEqual
static selectionsEqual: (a: ISelection, b: ISelection) => boolean;
Test if the two selections are equal.
method setEndPosition
setEndPosition: (endLineNumber: number, endColumn: number) => Selection;
Create a new selection with a different
positionLineNumber
andpositionColumn
.
method setStartPosition
setStartPosition: (startLineNumber: number, startColumn: number) => Selection;
Create a new selection with a different
selectionStartLineNumber
andselectionStartColumn
.
method toString
toString: () => string;
Transform to a human-readable representation.
class Token
class Token {}
constructor
constructor(offset: number, type: string, language: string);
property language
readonly language: string;
property offset
readonly offset: number;
property type
readonly type: string;
method toString
toString: () => string;
class Uri
class Uri implements UriComponents {}
Uniform Resource Identifier (Uri) http://tools.ietf.org/html/rfc3986. This class is a simple parser which creates the basic component parts (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation and encoding.
foo://example.com:8042/over/there?name=ferret#nose\_/ \______________/\_________/ \_________/ \__/| | | | |scheme authority path query fragment| _____________________|__/ \ / \urn:example:animal:ferret:nose
property authority
readonly authority: string;
authority is the 'www.example.com' part of 'http://www.example.com/some/path?query#fragment'. The part between the first double slashes and the next slash.
property fragment
readonly fragment: string;
fragment is the 'fragment' part of 'http://www.example.com/some/path?query#fragment'.
property fsPath
readonly fsPath: string;
Returns a string representing the corresponding file system path of this Uri. Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the platform specific path separator.
* Will *not* validate the path for invalid characters and semantics. * Will *not* look at the scheme of this Uri. * The result shall *not* be used for display purposes but for accessing a file on disk.
The *difference* to
Uri#path
is the use of the platform specific separator and the handling of UNC paths. See the below sample of a file-uri with an authority (UNC path).const u = Uri.parse('file://server/c$/folder/file.txt')u.authority === 'server'u.path === '/shares/c$/file.txt'u.fsPath === '\\server\c$\folder\file.txt'Using
Uri#path
to read a file (using fs-apis) would not be enough because parts of the path, namely the server name, would be missing. ThereforeUri#fsPath
exists - it's sugar to ease working with URIs that represent files on disk (file
scheme).
property path
readonly path: string;
path is the '/some/path' part of 'http://www.example.com/some/path?query#fragment'.
property query
readonly query: string;
query is the 'query' part of 'http://www.example.com/some/path?query#fragment'.
property scheme
readonly scheme: string;
scheme is the 'http' part of 'http://www.example.com/some/path?query#fragment'. The part before the first colon.
method file
static file: (path: string) => Uri;
Creates a new Uri from a file system path, e.g.
c:\my\files
,/usr/home
, or\\server\share\some\path
.The *difference* between
Uri#parse
andUri#file
is that the latter treats the argument as path, not as stringified-uri. E.g.Uri.file(path)
is **not the same as**Uri.parse('file://' + path)
because the path might contain characters that are interpreted (# and ?). See the following sample:const good = Uri.file('/coding/c#/project1');good.scheme === 'file';good.path === '/coding/c#/project1';good.fragment === '';const bad = Uri.parse('file://' + '/coding/c#/project1');bad.scheme === 'file';bad.path === '/coding/c'; // path is now brokenbad.fragment === '/project1';Parameter path
A file system path (see
Uri#fsPath
)
method from
static from: (components: UriComponents, strict?: boolean) => Uri;
Creates new Uri from uri components.
Unless
strict
istrue
the scheme is defaults to befile
. This function performs validation and should be used for untrusted uri components retrieved from storage, user input, command arguments etc
method isUri
static isUri: (thing: any) => thing is Uri;
method joinPath
static joinPath: (uri: Uri, ...pathFragment: string[]) => Uri;
Join a Uri path with path fragments and normalizes the resulting path.
Parameter uri
The input Uri.
Parameter pathFragment
The path fragment to add to the Uri path.
Returns
The resulting Uri.
method parse
static parse: (value: string, _strict?: boolean) => Uri;
Creates a new Uri from a string, e.g.
http://www.example.com/some/path
,file:///usr/home
, orscheme:with/path
.Parameter value
A string which represents an Uri (see
Uri#toString
).
method revive
static revive: { (data: UriComponents | Uri): Uri; (data: Uri | UriComponents): Uri; (data: Uri | UriComponents): Uri; (data: Uri | UriComponents): Uri;};
A helper function to revive URIs.
**Note** that this function should only be used when receiving Uri#toJSON generated data and that it doesn't do any validation. Use Uri.from when received "untrusted" uri components such as command arguments or data from storage.
Parameter data
The Uri components or Uri to revive.
Returns
The revived Uri or undefined or null.
method toJSON
toJSON: () => UriComponents;
method toString
toString: (skipEncoding?: boolean) => string;
Creates a string representation for this Uri. It's guaranteed that calling
Uri.parse
with the result of this function creates an Uri which is equal to this Uri.* The result shall *not* be used for display purposes but for externalization or transport. * The result will be encoded using the percentage encoding and encoding happens mostly ignore the scheme-specific encoding rules.
Parameter skipEncoding
Do not encode the result, default is
false
method with
with: (change: { scheme?: string; authority?: string | null; path?: string | null; query?: string | null; fragment?: string | null;}) => Uri;
Interfaces
interface CancellationToken
interface CancellationToken {}
property isCancellationRequested
readonly isCancellationRequested: boolean;
A flag signalling is cancellation has been requested.
property onCancellationRequested
readonly onCancellationRequested: ( listener: (e: any) => any, thisArgs?: any, disposables?: IDisposable[]) => IDisposable;
An event which fires when cancellation is requested. This event only ever fires
once
as cancellation can only happen once. Listeners that are registered after cancellation will be called (next event loop run), but also only once.
interface Environment
interface Environment {}
property baseUrl
baseUrl?: string;
The base url where the editor sources are found (which contains the vs folder)
property globalAPI
globalAPI?: boolean;
Define a global
monaco
symbol. This is true by default in AMD and false by default in ESM.
method createTrustedTypesPolicy
createTrustedTypesPolicy: ( policyName: string, policyOptions?: ITrustedTypePolicyOptions) => undefined | ITrustedTypePolicy;
Create a trusted types policy (same API as window.trustedTypes.createPolicy)
method getWorker
getWorker: (workerId: string, label: string) => Promise<Worker> | Worker;
A web worker factory. NOTE: If
getWorker
is defined,getWorkerUrl
is not invoked.
method getWorkerUrl
getWorkerUrl: (workerId: string, label: string) => string;
Return the location for web worker scripts. NOTE: If
getWorker
is defined,getWorkerUrl
is not invoked.
interface IDisposable
interface IDisposable {}
method dispose
dispose: () => void;
interface IEvent
interface IEvent<T> {}
call signature
(listener: (e: T) => any, thisArg?: any): IDisposable;
interface IKeyboardEvent
interface IKeyboardEvent {}
property altGraphKey
readonly altGraphKey: boolean;
property altKey
readonly altKey: boolean;
property browserEvent
readonly browserEvent: KeyboardEvent;
property code
readonly code: string;
property ctrlKey
readonly ctrlKey: boolean;
property keyCode
readonly keyCode: KeyCode;
property metaKey
readonly metaKey: boolean;
property shiftKey
readonly shiftKey: boolean;
property target
readonly target: HTMLElement;
method equals
equals: (keybinding: number) => boolean;
method preventDefault
preventDefault: () => void;
method stopPropagation
stopPropagation: () => void;
interface IMarkdownString
interface IMarkdownString {}
property baseUri
readonly baseUri?: UriComponents;
property isTrusted
readonly isTrusted?: boolean | MarkdownStringTrustedOptions;
property supportHtml
readonly supportHtml?: boolean;
property supportThemeIcons
readonly supportThemeIcons?: boolean;
property uris
uris?: { [href: string]: UriComponents;};
property value
readonly value: string;
interface IMouseEvent
interface IMouseEvent {}
property altKey
readonly altKey: boolean;
property browserEvent
readonly browserEvent: MouseEvent;
property buttons
readonly buttons: number;
property ctrlKey
readonly ctrlKey: boolean;
property detail
readonly detail: number;
property leftButton
readonly leftButton: boolean;
property metaKey
readonly metaKey: boolean;
property middleButton
readonly middleButton: boolean;
property posx
readonly posx: number;
property posy
readonly posy: number;
property rightButton
readonly rightButton: boolean;
property shiftKey
readonly shiftKey: boolean;
property target
readonly target: HTMLElement;
property timestamp
readonly timestamp: number;
method preventDefault
preventDefault: () => void;
method stopPropagation
stopPropagation: () => void;
interface IPosition
interface IPosition {}
A position in the editor. This interface is suitable for serialization.
property column
readonly column: number;
column (the first character in a line is between column 1 and column 2)
property lineNumber
readonly lineNumber: number;
line number (starts at 1)
interface IRange
interface IRange {}
A range in the editor. This interface is suitable for serialization.
property endColumn
readonly endColumn: number;
Column on which the range ends in line
endLineNumber
.
property endLineNumber
readonly endLineNumber: number;
Line number on which the range ends.
property startColumn
readonly startColumn: number;
Column on which the range starts in line
startLineNumber
(starts at 1).
property startLineNumber
readonly startLineNumber: number;
Line number on which the range starts (starts at 1).
interface IScrollEvent
interface IScrollEvent {}
property scrollHeight
readonly scrollHeight: number;
property scrollHeightChanged
readonly scrollHeightChanged: boolean;
property scrollLeft
readonly scrollLeft: number;
property scrollLeftChanged
readonly scrollLeftChanged: boolean;
property scrollTop
readonly scrollTop: number;
property scrollTopChanged
readonly scrollTopChanged: boolean;
property scrollWidth
readonly scrollWidth: number;
property scrollWidthChanged
readonly scrollWidthChanged: boolean;
interface ISelection
interface ISelection {}
A selection in the editor. The selection is a range that has an orientation.
property positionColumn
readonly positionColumn: number;
The column on
positionLineNumber
where the selection has ended.
property positionLineNumber
readonly positionLineNumber: number;
The line number on which the selection has ended.
property selectionStartColumn
readonly selectionStartColumn: number;
The column on
selectionStartLineNumber
where the selection has started.
property selectionStartLineNumber
readonly selectionStartLineNumber: number;
The line number on which the selection has started.
interface ITrustedTypePolicy
interface ITrustedTypePolicy {}
property name
readonly name: string;
method createHTML
createHTML: (input: string) => any;
method createScript
createScript: (input: string) => any;
method createScriptURL
createScriptURL: (input: string) => any;
interface ITrustedTypePolicyOptions
interface ITrustedTypePolicyOptions {}
property createHTML
createHTML?: (input: string, ...arguments: any[]) => string;
property createScript
createScript?: (input: string, ...arguments: any[]) => string;
property createScriptURL
createScriptURL?: (input: string, ...arguments: any[]) => string;
interface MarkdownStringTrustedOptions
interface MarkdownStringTrustedOptions {}
property enabledCommands
readonly enabledCommands: readonly string[];
interface UriComponents
interface UriComponents {}
interface Window
interface Window {}
property MonacoEnvironment
MonacoEnvironment?: Environment | undefined;
Enums
enum KeyCode
enum KeyCode { DependsOnKbLayout = -1, Unknown = 0, Backspace = 1, Tab = 2, Enter = 3, Shift = 4, Ctrl = 5, Alt = 6, PauseBreak = 7, CapsLock = 8, Escape = 9, Space = 10, PageUp = 11, PageDown = 12, End = 13, Home = 14, LeftArrow = 15, UpArrow = 16, RightArrow = 17, DownArrow = 18, Insert = 19, Delete = 20, Digit0 = 21, Digit1 = 22, Digit2 = 23, Digit3 = 24, Digit4 = 25, Digit5 = 26, Digit6 = 27, Digit7 = 28, Digit8 = 29, Digit9 = 30, KeyA = 31, KeyB = 32, KeyC = 33, KeyD = 34, KeyE = 35, KeyF = 36, KeyG = 37, KeyH = 38, KeyI = 39, KeyJ = 40, KeyK = 41, KeyL = 42, KeyM = 43, KeyN = 44, KeyO = 45, KeyP = 46, KeyQ = 47, KeyR = 48, KeyS = 49, KeyT = 50, KeyU = 51, KeyV = 52, KeyW = 53, KeyX = 54, KeyY = 55, KeyZ = 56, Meta = 57, ContextMenu = 58, F1 = 59, F2 = 60, F3 = 61, F4 = 62, F5 = 63, F6 = 64, F7 = 65, F8 = 66, F9 = 67, F10 = 68, F11 = 69, F12 = 70, F13 = 71, F14 = 72, F15 = 73, F16 = 74, F17 = 75, F18 = 76, F19 = 77, F20 = 78, F21 = 79, F22 = 80, F23 = 81, F24 = 82, NumLock = 83, ScrollLock = 84, Semicolon = 85, Equal = 86, Comma = 87, Minus = 88, Period = 89, Slash = 90, Backquote = 91, BracketLeft = 92, Backslash = 93, BracketRight = 94, Quote = 95, OEM_8 = 96, IntlBackslash = 97, Numpad0 = 98, Numpad1 = 99, Numpad2 = 100, Numpad3 = 101, Numpad4 = 102, Numpad5 = 103, Numpad6 = 104, Numpad7 = 105, Numpad8 = 106, Numpad9 = 107, NumpadMultiply = 108, NumpadAdd = 109, NUMPAD_SEPARATOR = 110, NumpadSubtract = 111, NumpadDecimal = 112, NumpadDivide = 113, KEY_IN_COMPOSITION = 114, ABNT_C1 = 115, ABNT_C2 = 116, AudioVolumeMute = 117, AudioVolumeUp = 118, AudioVolumeDown = 119, BrowserSearch = 120, BrowserHome = 121, BrowserBack = 122, BrowserForward = 123, MediaTrackNext = 124, MediaTrackPrevious = 125, MediaStop = 126, MediaPlayPause = 127, LaunchMediaPlayer = 128, LaunchMail = 129, LaunchApp2 = 130, Clear = 131, MAX_VALUE = 132,}
Virtual Key Codes, the value does not hold any inherent meaning. Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx But these are "more general", as they should work across browsers & OS`s.
member ABNT_C1
ABNT_C1 = 115
member ABNT_C2
ABNT_C2 = 116
member Alt
Alt = 6
member AudioVolumeDown
AudioVolumeDown = 119
member AudioVolumeMute
AudioVolumeMute = 117
member AudioVolumeUp
AudioVolumeUp = 118
member Backquote
Backquote = 91
Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '`~' key
member Backslash
Backslash = 93
Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '|' key
member Backspace
Backspace = 1
member BracketLeft
BracketLeft = 92
Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '[{' key
member BracketRight
BracketRight = 94
Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ']}' key
member BrowserBack
BrowserBack = 122
member BrowserForward
BrowserForward = 123
member BrowserHome
BrowserHome = 121
member BrowserSearch
BrowserSearch = 120
member CapsLock
CapsLock = 8
member Clear
Clear = 131
VK_CLEAR, 0x0C, CLEAR key
member Comma
Comma = 87
For any country/region, the ',' key For the US standard keyboard, the ',<' key
member ContextMenu
ContextMenu = 58
member Ctrl
Ctrl = 5
member Delete
Delete = 20
member DependsOnKbLayout
DependsOnKbLayout = -1
member Digit0
Digit0 = 21
member Digit1
Digit1 = 22
member Digit2
Digit2 = 23
member Digit3
Digit3 = 24
member Digit4
Digit4 = 25
member Digit5
Digit5 = 26
member Digit6
Digit6 = 27
member Digit7
Digit7 = 28
member Digit8
Digit8 = 29
member Digit9
Digit9 = 30
member DownArrow
DownArrow = 18
member End
End = 13
member Enter
Enter = 3
member Equal
Equal = 86
For any country/region, the '+' key For the US standard keyboard, the '=+' key
member Escape
Escape = 9
member F1
F1 = 59
member F10
F10 = 68
member F11
F11 = 69
member F12
F12 = 70
member F13
F13 = 71
member F14
F14 = 72
member F15
F15 = 73
member F16
F16 = 74
member F17
F17 = 75
member F18
F18 = 76
member F19
F19 = 77
member F2
F2 = 60
member F20
F20 = 78
member F21
F21 = 79
member F22
F22 = 80
member F23
F23 = 81
member F24
F24 = 82
member F3
F3 = 61
member F4
F4 = 62
member F5
F5 = 63
member F6
F6 = 64
member F7
F7 = 65
member F8
F8 = 66
member F9
F9 = 67
member Home
Home = 14
member Insert
Insert = 19
member IntlBackslash
IntlBackslash = 97
Either the angle bracket key or the backslash key on the RT 102-key keyboard.
member KEY_IN_COMPOSITION
KEY_IN_COMPOSITION = 114
Cover all key codes when IME is processing input.
member KeyA
KeyA = 31
member KeyB
KeyB = 32
member KeyC
KeyC = 33
member KeyD
KeyD = 34
member KeyE
KeyE = 35
member KeyF
KeyF = 36
member KeyG
KeyG = 37
member KeyH
KeyH = 38
member KeyI
KeyI = 39
member KeyJ
KeyJ = 40
member KeyK
KeyK = 41
member KeyL
KeyL = 42
member KeyM
KeyM = 43
member KeyN
KeyN = 44
member KeyO
KeyO = 45
member KeyP
KeyP = 46
member KeyQ
KeyQ = 47
member KeyR
KeyR = 48
member KeyS
KeyS = 49
member KeyT
KeyT = 50
member KeyU
KeyU = 51
member KeyV
KeyV = 52
member KeyW
KeyW = 53
member KeyX
KeyX = 54
member KeyY
KeyY = 55
member KeyZ
KeyZ = 56
member LaunchApp2
LaunchApp2 = 130
member LaunchMail
LaunchMail = 129
member LaunchMediaPlayer
LaunchMediaPlayer = 128
member LeftArrow
LeftArrow = 15
member MAX_VALUE
MAX_VALUE = 132
Placed last to cover the length of the enum. Please do not depend on this value!
member MediaPlayPause
MediaPlayPause = 127
member MediaStop
MediaStop = 126
member MediaTrackNext
MediaTrackNext = 124
member MediaTrackPrevious
MediaTrackPrevious = 125
member Meta
Meta = 57
member Minus
Minus = 88
For any country/region, the '-' key For the US standard keyboard, the '-_' key
member NumLock
NumLock = 83
member NUMPAD_SEPARATOR
NUMPAD_SEPARATOR = 110
member Numpad0
Numpad0 = 98
member Numpad1
Numpad1 = 99
member Numpad2
Numpad2 = 100
member Numpad3
Numpad3 = 101
member Numpad4
Numpad4 = 102
member Numpad5
Numpad5 = 103
member Numpad6
Numpad6 = 104
member Numpad7
Numpad7 = 105
member Numpad8
Numpad8 = 106
member Numpad9
Numpad9 = 107
member NumpadAdd
NumpadAdd = 109
member NumpadDecimal
NumpadDecimal = 112
member NumpadDivide
NumpadDivide = 113
member NumpadMultiply
NumpadMultiply = 108
member NumpadSubtract
NumpadSubtract = 111
member OEM_8
OEM_8 = 96
Used for miscellaneous characters; it can vary by keyboard.
member PageDown
PageDown = 12
member PageUp
PageUp = 11
member PauseBreak
PauseBreak = 7
member Period
Period = 89
For any country/region, the '.' key For the US standard keyboard, the '.>' key
member Quote
Quote = 95
Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ''"' key
member RightArrow
RightArrow = 17
member ScrollLock
ScrollLock = 84
member Semicolon
Semicolon = 85
Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ';:' key
member Shift
Shift = 4
member Slash
Slash = 90
Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '/?' key
member Space
Space = 10
member Tab
Tab = 2
member Unknown
Unknown = 0
Placed first to cover the 0 value of the enum.
member UpArrow
UpArrow = 16
enum MarkerSeverity
enum MarkerSeverity { Hint = 1, Info = 2, Warning = 4, Error = 8,}
enum MarkerTag
enum MarkerTag { Unnecessary = 1, Deprecated = 2,}
member Deprecated
Deprecated = 2
member Unnecessary
Unnecessary = 1
enum SelectionDirection
enum SelectionDirection { LTR = 0, RTL = 1,}
The direction of a selection.
Type Aliases
type Thenable
type Thenable<T> = PromiseLike<T>;
Namespaces
namespace editor
namespace editor {}
variable EditorOptions
const EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption< EditorOption.acceptSuggestionOnCommitCharacter, boolean >; acceptSuggestionOnEnter: IEditorOption< EditorOption.acceptSuggestionOnEnter, 'on' | 'off' | 'smart' >; accessibilitySupport: IEditorOption< EditorOption.accessibilitySupport, AccessibilitySupport >; accessibilityPageSize: IEditorOption<EditorOption.accessibilityPageSize, number>; ariaLabel: IEditorOption<EditorOption.ariaLabel, string>; ariaRequired: IEditorOption<EditorOption.ariaRequired, boolean>; screenReaderAnnounceInlineSuggestion: IEditorOption< EditorOption.screenReaderAnnounceInlineSuggestion, boolean >; autoClosingBrackets: IEditorOption< EditorOption.autoClosingBrackets, 'always' | 'languageDefined' | 'beforeWhitespace' | 'never' >; autoClosingComments: IEditorOption< EditorOption.autoClosingComments, 'always' | 'languageDefined' | 'beforeWhitespace' | 'never' >; autoClosingDelete: IEditorOption< EditorOption.autoClosingDelete, 'auto' | 'always' | 'never' >; autoClosingOvertype: IEditorOption< EditorOption.autoClosingOvertype, 'auto' | 'always' | 'never' >; autoClosingQuotes: IEditorOption< EditorOption.autoClosingQuotes, 'always' | 'languageDefined' | 'beforeWhitespace' | 'never' >; autoIndent: IEditorOption<EditorOption.autoIndent, EditorAutoIndentStrategy>; automaticLayout: IEditorOption<EditorOption.automaticLayout, boolean>; autoSurround: IEditorOption< EditorOption.autoSurround, 'languageDefined' | 'never' | 'quotes' | 'brackets' >; bracketPairColorization: IEditorOption< EditorOption.bracketPairColorization, Readonly<Required<IBracketPairColorizationOptions>> >; bracketPairGuides: IEditorOption< EditorOption.guides, Readonly<Required<IGuidesOptions>> >; stickyTabStops: IEditorOption<EditorOption.stickyTabStops, boolean>; codeLens: IEditorOption<EditorOption.codeLens, boolean>; codeLensFontFamily: IEditorOption<EditorOption.codeLensFontFamily, string>; codeLensFontSize: IEditorOption<EditorOption.codeLensFontSize, number>; colorDecorators: IEditorOption<EditorOption.colorDecorators, boolean>; colorDecoratorActivatedOn: IEditorOption< EditorOption.colorDecoratorsActivatedOn, 'hover' | 'clickAndHover' | 'click' >; colorDecoratorsLimit: IEditorOption<EditorOption.colorDecoratorsLimit, number>; columnSelection: IEditorOption<EditorOption.columnSelection, boolean>; comments: IEditorOption< EditorOption.comments, Readonly<Required<IEditorCommentsOptions>> >; contextmenu: IEditorOption<EditorOption.contextmenu, boolean>; copyWithSyntaxHighlighting: IEditorOption< EditorOption.copyWithSyntaxHighlighting, boolean >; cursorBlinking: IEditorOption< EditorOption.cursorBlinking, TextEditorCursorBlinkingStyle >; cursorSmoothCaretAnimation: IEditorOption< EditorOption.cursorSmoothCaretAnimation, 'on' | 'off' | 'explicit' >; cursorStyle: IEditorOption<EditorOption.cursorStyle, TextEditorCursorStyle>; cursorSurroundingLines: IEditorOption< EditorOption.cursorSurroundingLines, number >; cursorSurroundingLinesStyle: IEditorOption< EditorOption.cursorSurroundingLinesStyle, 'default' | 'all' >; cursorWidth: IEditorOption<EditorOption.cursorWidth, number>; disableLayerHinting: IEditorOption<EditorOption.disableLayerHinting, boolean>; disableMonospaceOptimizations: IEditorOption< EditorOption.disableMonospaceOptimizations, boolean >; domReadOnly: IEditorOption<EditorOption.domReadOnly, boolean>; dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>; emptySelectionClipboard: IEditorOption< EditorOption.emptySelectionClipboard, boolean >; dropIntoEditor: IEditorOption< EditorOption.dropIntoEditor, Readonly<Required<IDropIntoEditorOptions>> >; stickyScroll: IEditorOption< EditorOption.stickyScroll, Readonly<Required<IEditorStickyScrollOptions>> >; experimentalWhitespaceRendering: IEditorOption< EditorOption.experimentalWhitespaceRendering, 'off' | 'svg' | 'font' >; extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>; fastScrollSensitivity: IEditorOption<EditorOption.fastScrollSensitivity, number>; find: IEditorOption<EditorOption.find, Readonly<Required<IEditorFindOptions>>>; fixedOverflowWidgets: IEditorOption<EditorOption.fixedOverflowWidgets, boolean>; folding: IEditorOption<EditorOption.folding, boolean>; foldingStrategy: IEditorOption< EditorOption.foldingStrategy, 'auto' | 'indentation' >; foldingHighlight: IEditorOption<EditorOption.foldingHighlight, boolean>; foldingImportsByDefault: IEditorOption< EditorOption.foldingImportsByDefault, boolean >; foldingMaximumRegions: IEditorOption<EditorOption.foldingMaximumRegions, number>; unfoldOnClickAfterEndOfLine: IEditorOption< EditorOption.unfoldOnClickAfterEndOfLine, boolean >; fontFamily: IEditorOption<EditorOption.fontFamily, string>; fontInfo: IEditorOption<EditorOption.fontInfo, FontInfo>; fontLigatures2: IEditorOption<EditorOption.fontLigatures, string>; fontSize: IEditorOption<EditorOption.fontSize, number>; fontWeight: IEditorOption<EditorOption.fontWeight, string>; fontVariations: IEditorOption<EditorOption.fontVariations, string>; formatOnPaste: IEditorOption<EditorOption.formatOnPaste, boolean>; formatOnType: IEditorOption<EditorOption.formatOnType, boolean>; glyphMargin: IEditorOption<EditorOption.glyphMargin, boolean>; gotoLocation: IEditorOption< EditorOption.gotoLocation, Readonly<Required<IGotoLocationOptions>> >; hideCursorInOverviewRuler: IEditorOption< EditorOption.hideCursorInOverviewRuler, boolean >; hover: IEditorOption< EditorOption.hover, Readonly<Required<IEditorHoverOptions>> >; inDiffEditor: IEditorOption<EditorOption.inDiffEditor, boolean>; letterSpacing: IEditorOption<EditorOption.letterSpacing, number>; lightbulb: IEditorOption< EditorOption.lightbulb, Readonly<Required<IEditorLightbulbOptions>> >; lineDecorationsWidth: IEditorOption<EditorOption.lineDecorationsWidth, number>; lineHeight: IEditorOption<EditorOption.lineHeight, number>; lineNumbers: IEditorOption< EditorOption.lineNumbers, InternalEditorRenderLineNumbersOptions >; lineNumbersMinChars: IEditorOption<EditorOption.lineNumbersMinChars, number>; linkedEditing: IEditorOption<EditorOption.linkedEditing, boolean>; links: IEditorOption<EditorOption.links, boolean>; matchBrackets: IEditorOption< EditorOption.matchBrackets, 'always' | 'never' | 'near' >; minimap: IEditorOption< EditorOption.minimap, Readonly<Required<IEditorMinimapOptions>> >; mouseStyle: IEditorOption<EditorOption.mouseStyle, 'default' | 'text' | 'copy'>; mouseWheelScrollSensitivity: IEditorOption< EditorOption.mouseWheelScrollSensitivity, number >; mouseWheelZoom: IEditorOption<EditorOption.mouseWheelZoom, boolean>; multiCursorMergeOverlapping: IEditorOption< EditorOption.multiCursorMergeOverlapping, boolean >; multiCursorModifier: IEditorOption< EditorOption.multiCursorModifier, 'altKey' | 'metaKey' | 'ctrlKey' >; multiCursorPaste: IEditorOption< EditorOption.multiCursorPaste, 'spread' | 'full' >; multiCursorLimit: IEditorOption<EditorOption.multiCursorLimit, number>; occurrencesHighlight: IEditorOption< EditorOption.occurrencesHighlight, 'off' | 'singleFile' | 'multiFile' >; overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>; overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>; padding: IEditorOption< EditorOption.padding, Readonly<Required<IEditorPaddingOptions>> >; pasteAs: IEditorOption< EditorOption.pasteAs, Readonly<Required<IPasteAsOptions>> >; parameterHints: IEditorOption< EditorOption.parameterHints, Readonly<Required<IEditorParameterHintOptions>> >; peekWidgetDefaultFocus: IEditorOption< EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor' >; placeholder: IEditorOption<EditorOption.placeholder, string>; definitionLinkOpensInPeek: IEditorOption< EditorOption.definitionLinkOpensInPeek, boolean >; quickSuggestions: IEditorOption< EditorOption.quickSuggestions, InternalQuickSuggestionsOptions >; quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>; readOnly: IEditorOption<EditorOption.readOnly, boolean>; readOnlyMessage: IEditorOption<EditorOption.readOnlyMessage, any>; renameOnType: IEditorOption<EditorOption.renameOnType, boolean>; renderControlCharacters: IEditorOption< EditorOption.renderControlCharacters, boolean >; renderFinalNewline: IEditorOption< EditorOption.renderFinalNewline, 'on' | 'off' | 'dimmed' >; renderLineHighlight: IEditorOption< EditorOption.renderLineHighlight, 'all' | 'line' | 'none' | 'gutter' >; renderLineHighlightOnlyWhenFocus: IEditorOption< EditorOption.renderLineHighlightOnlyWhenFocus, boolean >; renderValidationDecorations: IEditorOption< EditorOption.renderValidationDecorations, 'on' | 'off' | 'editable' >; renderWhitespace: IEditorOption< EditorOption.renderWhitespace, 'all' | 'none' | 'boundary' | 'selection' | 'trailing' >; revealHorizontalRightPadding: IEditorOption< EditorOption.revealHorizontalRightPadding, number >; roundedSelection: IEditorOption<EditorOption.roundedSelection, boolean>; rulers: IEditorOption<EditorOption.rulers, {}>; scrollbar: IEditorOption<EditorOption.scrollbar, InternalEditorScrollbarOptions>; scrollBeyondLastColumn: IEditorOption< EditorOption.scrollBeyondLastColumn, number >; scrollBeyondLastLine: IEditorOption<EditorOption.scrollBeyondLastLine, boolean>; scrollPredominantAxis: IEditorOption< EditorOption.scrollPredominantAxis, boolean >; selectionClipboard: IEditorOption<EditorOption.selectionClipboard, boolean>; selectionHighlight: IEditorOption<EditorOption.selectionHighlight, boolean>; selectOnLineNumbers: IEditorOption<EditorOption.selectOnLineNumbers, boolean>; showFoldingControls: IEditorOption< EditorOption.showFoldingControls, 'always' | 'never' | 'mouseover' >; showUnused: IEditorOption<EditorOption.showUnused, boolean>; showDeprecated: IEditorOption<EditorOption.showDeprecated, boolean>; inlayHints: IEditorOption< EditorOption.inlayHints, Readonly<Required<IEditorInlayHintsOptions>> >; snippetSuggestions: IEditorOption< EditorOption.snippetSuggestions, 'none' | 'top' | 'bottom' | 'inline' >; smartSelect: IEditorOption< EditorOption.smartSelect, Readonly<Required<ISmartSelectOptions>> >; smoothScrolling: IEditorOption<EditorOption.smoothScrolling, boolean>; stopRenderingLineAfter: IEditorOption< EditorOption.stopRenderingLineAfter, number >; suggest: IEditorOption< EditorOption.suggest, Readonly<Required<ISuggestOptions>> >; inlineSuggest: IEditorOption< EditorOption.inlineSuggest, Readonly<Required<IInlineSuggestOptions>> >; inlineEdit: IEditorOption< EditorOption.inlineEdit, Readonly<Required<IInlineEditOptions>> >; inlineCompletionsAccessibilityVerbose: IEditorOption< EditorOption.inlineCompletionsAccessibilityVerbose, boolean >; suggestFontSize: IEditorOption<EditorOption.suggestFontSize, number>; suggestLineHeight: IEditorOption<EditorOption.suggestLineHeight, number>; suggestOnTriggerCharacters: IEditorOption< EditorOption.suggestOnTriggerCharacters, boolean >; suggestSelection: IEditorOption< EditorOption.suggestSelection, 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix' >; tabCompletion: IEditorOption< EditorOption.tabCompletion, 'on' | 'off' | 'onlySnippets' >; tabIndex: IEditorOption<EditorOption.tabIndex, number>; unicodeHighlight: IEditorOption<EditorOption.unicodeHighlighting, any>; unusualLineTerminators: IEditorOption< EditorOption.unusualLineTerminators, 'off' | 'auto' | 'prompt' >; useShadowDOM: IEditorOption<EditorOption.useShadowDOM, boolean>; useTabStops: IEditorOption<EditorOption.useTabStops, boolean>; wordBreak: IEditorOption<EditorOption.wordBreak, 'normal' | 'keepAll'>; wordSegmenterLocales: IEditorOption<EditorOption.wordSegmenterLocales, {}>; wordSeparators: IEditorOption<EditorOption.wordSeparators, string>; wordWrap: IEditorOption< EditorOption.wordWrap, 'wordWrapColumn' | 'on' | 'off' | 'bounded' >; wordWrapBreakAfterCharacters: IEditorOption< EditorOption.wordWrapBreakAfterCharacters, string >; wordWrapBreakBeforeCharacters: IEditorOption< EditorOption.wordWrapBreakBeforeCharacters, string >; wordWrapColumn: IEditorOption<EditorOption.wordWrapColumn, number>; wordWrapOverride1: IEditorOption< EditorOption.wordWrapOverride1, 'on' | 'off' | 'inherit' >; wordWrapOverride2: IEditorOption< EditorOption.wordWrapOverride2, 'on' | 'off' | 'inherit' >; editorClassName: IEditorOption<EditorOption.editorClassName, string>; defaultColorDecorators: IEditorOption< EditorOption.defaultColorDecorators, boolean >; pixelRatio: IEditorOption<EditorOption.pixelRatio, number>; tabFocusMode: IEditorOption<EditorOption.tabFocusMode, boolean>; layoutInfo: IEditorOption<EditorOption.layoutInfo, EditorLayoutInfo>; wrappingInfo: IEditorOption<EditorOption.wrappingInfo, EditorWrappingInfo>; wrappingIndent: IEditorOption<EditorOption.wrappingIndent, WrappingIndent>; wrappingStrategy: IEditorOption< EditorOption.wrappingStrategy, 'simple' | 'advanced' >;};
variable EditorType
const EditorType: { ICodeEditor: string; IDiffEditor: string };
The type of the
IEditor
.
variable EditorZoom
const EditorZoom: IEditorZoom;
function addCommand
addCommand: (descriptor: ICommandDescriptor) => IDisposable;
Add a command.
function addEditorAction
addEditorAction: (descriptor: IActionDescriptor) => IDisposable;
Add an action to all editors.
function addKeybindingRule
addKeybindingRule: (rule: IKeybindingRule) => IDisposable;
Add a keybinding rule.
function addKeybindingRules
addKeybindingRules: (rules: IKeybindingRule[]) => IDisposable;
Add keybinding rules.
function colorize
colorize: ( text: string, languageId: string, options: IColorizerOptions) => Promise<string>;
Colorize
text
using languagelanguageId
.
function colorizeElement
colorizeElement: ( domNode: HTMLElement, options: IColorizerElementOptions) => Promise<void>;
Colorize the contents of
domNode
using attributedata-lang
.
function colorizeModelLine
colorizeModelLine: ( model: ITextModel, lineNumber: number, tabSize?: number) => string;
Colorize a line in a model.
function create
create: ( domElement: HTMLElement, options?: IStandaloneEditorConstructionOptions, override?: IEditorOverrideServices) => IStandaloneCodeEditor;
Create a new editor under
domElement
.domElement
should be empty (not contain other dom nodes). The editor will read the size ofdomElement
.
function createDiffEditor
createDiffEditor: ( domElement: HTMLElement, options?: IStandaloneDiffEditorConstructionOptions, override?: IEditorOverrideServices) => IStandaloneDiffEditor;
Create a new diff editor under
domElement
.domElement
should be empty (not contain other dom nodes). The editor will read the size ofdomElement
.
function 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
.
function createMultiFileDiffEditor
createMultiFileDiffEditor: ( domElement: HTMLElement, override?: IEditorOverrideServices) => any;
function createWebWorker
createWebWorker: <T extends object>( opts: IWebWorkerOptions) => MonacoWebWorker<T>;
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.
function defineTheme
defineTheme: (themeName: string, themeData: IStandaloneThemeData) => void;
Define a new theme or update an existing theme.
function getDiffEditors
getDiffEditors: () => readonly IDiffEditor[];
Get all the created diff editors.
function getEditors
getEditors: () => readonly ICodeEditor[];
Get all the created editors.
function getModel
getModel: (uri: Uri) => ITextModel | null;
Get the model that has
uri
if it exists.
function getModelMarkers
getModelMarkers: (filter: { owner?: string; resource?: Uri; take?: number;}) => IMarker[];
Get markers for owner and/or resource
Returns
list of markers
function getModels
getModels: () => ITextModel[];
Get all the created models.
function onDidChangeMarkers
onDidChangeMarkers: (listener: (e: readonly Uri[]) => void) => IDisposable;
Emitted when markers change for a model.
function onDidChangeModelLanguage
onDidChangeModelLanguage: ( listener: (e: { readonly model: ITextModel; readonly oldLanguage: string; }) => void) => IDisposable;
Emitted when a different language is set to a model.
function onDidCreateDiffEditor
onDidCreateDiffEditor: ( listener: (diffEditor: IDiffEditor) => void) => IDisposable;
Emitted when an diff editor is created.
function onDidCreateEditor
onDidCreateEditor: (listener: (codeEditor: ICodeEditor) => void) => IDisposable;
Emitted when an editor is created. Creating a diff editor might cause this listener to be invoked with the two editors.
function onDidCreateModel
onDidCreateModel: (listener: (model: ITextModel) => void) => IDisposable;
Emitted when a model is created.
function onWillDisposeModel
onWillDisposeModel: (listener: (model: ITextModel) => void) => IDisposable;
Emitted right before a model is disposed.
function registerCommand
registerCommand: ( id: string, handler: (accessor: any, ...args: any[]) => void) => IDisposable;
Register a command.
function registerEditorOpener
registerEditorOpener: (opener: ICodeEditorOpener) => IDisposable;
Registers a handler that is called when a resource other than the current model should be opened in the editor (e.g. "go to definition"). The handler callback should return
true
if the request was handled andfalse
otherwise.Returns a disposable that can unregister the opener again.
If no handler is registered the default behavior is to do nothing for models other than the currently attached one.
function registerLinkOpener
registerLinkOpener: (opener: ILinkOpener) => IDisposable;
Registers a handler that is called when a link is opened in any editor. The handler callback should return
true
if the link was handled andfalse
otherwise. The handler that was registered last will be called first when a link is opened.Returns a disposable that can unregister the opener again.
function remeasureFonts
remeasureFonts: () => void;
Clears all cached font measurements and triggers re-measurement.
function removeAllMarkers
removeAllMarkers: (owner: string) => void;
Remove all markers of an owner.
function setModelLanguage
setModelLanguage: (model: ITextModel, mimeTypeOrLanguageId: string) => void;
Change the language for a model.
function setModelMarkers
setModelMarkers: ( model: ITextModel, owner: string, markers: IMarkerData[]) => void;
Set the markers for a model.
function setTheme
setTheme: (themeName: string) => void;
Switches to a theme.
function tokenize
tokenize: (text: string, languageId: string) => Token[][];
Tokenize
text
using languagelanguageId
class ApplyUpdateResult
class ApplyUpdateResult<T> {}
constructor
constructor(newValue: {}, didChange: boolean);
property didChange
readonly didChange: boolean;
property newValue
readonly newValue: {};
class BareFontInfo
class BareFontInfo {}
property fontFamily
readonly fontFamily: string;
property fontFeatureSettings
readonly fontFeatureSettings: string;
property fontSize
readonly fontSize: number;
property fontVariationSettings
readonly fontVariationSettings: string;
property fontWeight
readonly fontWeight: string;
property letterSpacing
readonly letterSpacing: number;
property lineHeight
readonly lineHeight: number;
property pixelRatio
readonly pixelRatio: number;
class ConfigurationChangedEvent
class ConfigurationChangedEvent {}
An event describing that the configuration of the editor has changed.
method hasChanged
hasChanged: (id: EditorOption) => boolean;
class FindMatch
class FindMatch {}
class FontInfo
class FontInfo extends BareFontInfo {}
property canUseHalfwidthRightwardsArrow
readonly canUseHalfwidthRightwardsArrow: boolean;
property isMonospace
readonly isMonospace: boolean;
property isTrusted
readonly isTrusted: boolean;
property maxDigitWidth
readonly maxDigitWidth: number;
property middotWidth
readonly middotWidth: number;
property spaceWidth
readonly spaceWidth: number;
property typicalFullwidthCharacterWidth
readonly typicalFullwidthCharacterWidth: number;
property typicalHalfwidthCharacterWidth
readonly typicalHalfwidthCharacterWidth: number;
property version
readonly version: number;
property wsmiddotWidth
readonly wsmiddotWidth: number;
class TextModelResolvedOptions
class TextModelResolvedOptions {}
property bracketPairColorizationOptions
readonly bracketPairColorizationOptions: BracketPairColorizationOptions;
property defaultEOL
readonly defaultEOL: DefaultEndOfLine;
property indentSize
readonly indentSize: number;
property insertSpaces
readonly insertSpaces: boolean;
property originalIndentSize
readonly originalIndentSize: number | 'tabSize';
property tabSize
readonly tabSize: number;
property trimAutoWhitespace
readonly trimAutoWhitespace: boolean;
interface BracketPairColorizationOptions
interface BracketPairColorizationOptions {}
property enabled
enabled: boolean;
property independentColorPoolPerBracketType
independentColorPoolPerBracketType: boolean;
interface EditorLayoutInfo
interface EditorLayoutInfo {}
The internal layout details of the editor.
property contentLeft
readonly contentLeft: number;
Left position for the content (actual text)
property contentWidth
readonly contentWidth: number;
The width of the content (actual text)
property decorationsLeft
readonly decorationsLeft: number;
Left position for the line decorations.
property decorationsWidth
readonly decorationsWidth: number;
The width of the line decorations.
property glyphMarginDecorationLaneCount
readonly glyphMarginDecorationLaneCount: number;
The number of decoration lanes to render in the glyph margin.
property glyphMarginLeft
readonly glyphMarginLeft: number;
Left position for the glyph margin.
property glyphMarginWidth
readonly glyphMarginWidth: number;
The width of the glyph margin.
property height
readonly height: number;
Full editor height.
property horizontalScrollbarHeight
readonly horizontalScrollbarHeight: number;
The height of the horizontal scrollbar.
property isViewportWrapping
readonly isViewportWrapping: boolean;
property isWordWrapMinified
readonly isWordWrapMinified: boolean;
property lineNumbersLeft
readonly lineNumbersLeft: number;
Left position for the line numbers.
property lineNumbersWidth
readonly lineNumbersWidth: number;
The width of the line numbers.
property minimap
readonly minimap: EditorMinimapLayoutInfo;
Layout information for the minimap
property overviewRuler
readonly overviewRuler: OverviewRulerPosition;
The position of the overview ruler.
property verticalScrollbarWidth
readonly verticalScrollbarWidth: number;
The width of the vertical scrollbar.
property viewportColumn
readonly viewportColumn: number;
The number of columns (of typical characters) fitting on a viewport line.
property width
readonly width: number;
Full editor width.
property wrappingColumn
readonly wrappingColumn: number;
interface EditorMinimapLayoutInfo
interface EditorMinimapLayoutInfo {}
The internal layout details of the editor.
property minimapCanvasInnerHeight
readonly minimapCanvasInnerHeight: number;
property minimapCanvasInnerWidth
readonly minimapCanvasInnerWidth: number;
property minimapCanvasOuterHeight
readonly minimapCanvasOuterHeight: number;
property minimapCanvasOuterWidth
readonly minimapCanvasOuterWidth: number;
property minimapHeightIsEditorHeight
readonly minimapHeightIsEditorHeight: boolean;
property minimapIsSampling
readonly minimapIsSampling: boolean;
property minimapLeft
readonly minimapLeft: number;
property minimapLineHeight
readonly minimapLineHeight: number;
property minimapScale
readonly minimapScale: number;
property minimapWidth
readonly minimapWidth: number;
property renderMinimap
readonly renderMinimap: RenderMinimap;
interface EditorWrappingInfo
interface EditorWrappingInfo {}
property isDominatedByLongLines
readonly isDominatedByLongLines: boolean;
property isViewportWrapping
readonly isViewportWrapping: boolean;
property isWordWrapMinified
readonly isWordWrapMinified: boolean;
property wrappingColumn
readonly wrappingColumn: number;
interface IActionDescriptor
interface IActionDescriptor {}
Description of an action contribution
property contextMenuGroupId
contextMenuGroupId?: string;
Control if the action should show up in the context menu and where. The context menu of the editor has these default: navigation - The navigation group comes first in all cases. 1_modification - This group comes next and contains commands that modify your code. 9_cutcopypaste - The last default group with the basic editing commands. You can also create your own group. Defaults to null (don't show in context menu).
property contextMenuOrder
contextMenuOrder?: number;
Control the order in the context menu group.
property id
id: string;
An unique identifier of the contributed action.
property keybindingContext
keybindingContext?: string;
The keybinding rule (condition on top of precondition).
property keybindings
keybindings?: number[];
An array of keybindings for the action.
property label
label: string;
A label of the action that will be presented to the user.
property precondition
precondition?: string;
Precondition rule. The value should be a [context key expression](https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts).
method run
run: (editor: ICodeEditor, ...args: any[]) => void | Promise<void>;
Method that will be executed when the action is triggered.
Parameter editor
The editor instance is passed in as a convenience
interface IBaseMouseTarget
interface IBaseMouseTarget {}
property element
readonly element: HTMLElement | null;
The target element
property mouseColumn
readonly mouseColumn: number;
Desired mouse column (e.g. when position.column gets clamped to text length -- clicking after text on a line).
property position
readonly position: Position | null;
The 'approximate' editor position
property range
readonly range: Range | null;
The 'approximate' editor range
interface IBracketPairColorizationOptions
interface IBracketPairColorizationOptions {}
property enabled
enabled?: boolean;
Enable or disable bracket pair colorization.
property independentColorPoolPerBracketType
independentColorPoolPerBracketType?: boolean;
Use independent color pool per bracket type.
interface IChange
interface IChange {}
A change
property modifiedEndLineNumber
readonly modifiedEndLineNumber: number;
property modifiedStartLineNumber
readonly modifiedStartLineNumber: number;
property originalEndLineNumber
readonly originalEndLineNumber: number;
property originalStartLineNumber
readonly originalStartLineNumber: number;
interface ICharChange
interface ICharChange extends IChange {}
A character level change.
property modifiedEndColumn
readonly modifiedEndColumn: number;
property modifiedStartColumn
readonly modifiedStartColumn: number;
property originalEndColumn
readonly originalEndColumn: number;
property originalStartColumn
readonly originalStartColumn: number;
interface ICodeEditor
interface ICodeEditor extends IEditor {}
A rich code editor.
property onBeginUpdate
readonly onBeginUpdate: IEvent<void>;
Some editor operations fire multiple events at once. To allow users to react to multiple events fired by a single operation, the editor fires a begin update before the operation and an end update after the operation. Whenever the editor fires
onBeginUpdate
, it will also fireonEndUpdate
once the operation finishes. Note that not all operations are bracketed byonBeginUpdate
andonEndUpdate
.
property onContextMenu
readonly onContextMenu: IEvent<IEditorMouseEvent>;
An event emitted on a "contextmenu".
property onDidAttemptReadOnlyEdit
readonly onDidAttemptReadOnlyEdit: IEvent<void>;
An event emitted when editing failed because the editor is read-only.
property onDidBlurEditorText
readonly onDidBlurEditorText: IEvent<void>;
An event emitted when the text inside this editor lost focus (i.e. cursor stops blinking).
property onDidBlurEditorWidget
readonly onDidBlurEditorWidget: IEvent<void>;
An event emitted when the text inside this editor or an editor widget lost focus.
property onDidChangeConfiguration
readonly onDidChangeConfiguration: IEvent<ConfigurationChangedEvent>;
An event emitted when the configuration of the editor has changed. (e.g.
editor.updateOptions()
)
property onDidChangeCursorPosition
readonly onDidChangeCursorPosition: IEvent<ICursorPositionChangedEvent>;
An event emitted when the cursor position has changed.
property onDidChangeCursorSelection
readonly onDidChangeCursorSelection: IEvent<ICursorSelectionChangedEvent>;
An event emitted when the cursor selection has changed.
property onDidChangeHiddenAreas
readonly onDidChangeHiddenAreas: IEvent<void>;
An event emitted when hidden areas change in the editor (e.g. due to folding).
property onDidChangeModel
readonly onDidChangeModel: IEvent<IModelChangedEvent>;
An event emitted when the model of this editor has changed (e.g.
editor.setModel()
).
property onDidChangeModelContent
readonly onDidChangeModelContent: IEvent<IModelContentChangedEvent>;
An event emitted when the content of the current model has changed.
property onDidChangeModelDecorations
readonly onDidChangeModelDecorations: IEvent<IModelDecorationsChangedEvent>;
An event emitted when the decorations of the current model have changed.
property onDidChangeModelLanguage
readonly onDidChangeModelLanguage: IEvent<IModelLanguageChangedEvent>;
An event emitted when the language of the current model has changed.
property onDidChangeModelLanguageConfiguration
readonly onDidChangeModelLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>;
An event emitted when the language configuration of the current model has changed.
property onDidChangeModelOptions
readonly onDidChangeModelOptions: IEvent<IModelOptionsChangedEvent>;
An event emitted when the options of the current model has changed.
property onDidCompositionEnd
readonly onDidCompositionEnd: IEvent<void>;
An event emitted after composition has ended.
property onDidCompositionStart
readonly onDidCompositionStart: IEvent<void>;
An event emitted after composition has started.
property onDidContentSizeChange
readonly onDidContentSizeChange: IEvent<IContentSizeChangedEvent>;
An event emitted when the content width or content height in the editor has changed.
property onDidFocusEditorText
readonly onDidFocusEditorText: IEvent<void>;
An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking).
property onDidFocusEditorWidget
readonly onDidFocusEditorWidget: IEvent<void>;
An event emitted when the text inside this editor or an editor widget gained focus.
property onDidLayoutChange
readonly onDidLayoutChange: IEvent<EditorLayoutInfo>;
An event emitted when the layout of the editor has changed.
property onDidPaste
readonly onDidPaste: IEvent<IPasteEvent>;
An event emitted when users paste text in the editor.
property onDidScrollChange
readonly onDidScrollChange: IEvent<IScrollEvent>;
An event emitted when the scroll in the editor has changed.
property onEndUpdate
readonly onEndUpdate: IEvent<void>;
Fires after the editor completes the operation it fired
onBeginUpdate
for.
property onKeyDown
readonly onKeyDown: IEvent<IKeyboardEvent>;
An event emitted on a "keydown".
property onKeyUp
readonly onKeyUp: IEvent<IKeyboardEvent>;
An event emitted on a "keyup".
property onMouseDown
readonly onMouseDown: IEvent<IEditorMouseEvent>;
An event emitted on a "mousedown".
property onMouseLeave
readonly onMouseLeave: IEvent<IPartialEditorMouseEvent>;
An event emitted on a "mouseleave".
property onMouseMove
readonly onMouseMove: IEvent<IEditorMouseEvent>;
An event emitted on a "mousemove".
property onMouseUp
readonly onMouseUp: IEvent<IEditorMouseEvent>;
An event emitted on a "mouseup".
property onWillChangeModel
readonly onWillChangeModel: IEvent<IModelChangedEvent>;
An event emitted when the model of this editor is about to change (e.g. from
editor.setModel()
).
method addContentWidget
addContentWidget: (widget: IContentWidget) => void;
Add a content widget. Widgets must have unique ids, otherwise they will be overwritten.
method addGlyphMarginWidget
addGlyphMarginWidget: (widget: IGlyphMarginWidget) => void;
Add a glyph margin widget. Widgets must have unique ids, otherwise they will be overwritten.
method addOverlayWidget
addOverlayWidget: (widget: IOverlayWidget) => void;
Add an overlay widget. Widgets must have unique ids, otherwise they will be overwritten.
method applyFontInfo
applyFontInfo: (target: HTMLElement) => void;
Apply the same font settings as the editor to
target
.
method changeViewZones
changeViewZones: (callback: (accessor: IViewZoneChangeAccessor) => void) => void;
Change the view zones. View zones are lost when a new model is attached to the editor.
method deltaDecorations
deltaDecorations: ( oldDecorations: string[], newDecorations: IModelDeltaDecoration[]) => string[];
All decorations added through this call will get the ownerId of this editor.
See Also
createDecorationsCollection
Deprecated
Use
createDecorationsCollection
method executeCommand
executeCommand: (source: string | null | undefined, 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.
Parameter source
The source of the call.
Parameter command
The command to execute
method executeCommands
executeCommands: ( source: string | null | undefined, commands: (ICommand | null)[]) => void;
Execute multiple (concomitant) commands on the editor.
Parameter source
The source of the call.
Parameter command
The commands to execute
method executeEdits
executeEdits: ( source: string | null | undefined, 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.
Parameter source
The source of the call.
Parameter edits
The edits to execute.
Parameter endCursorState
Cursor state after the edits were applied.
method getAction
getAction: (id: string) => IEditorAction | null;
Get an action that is a contribution to this editor. Unique identifier of the contribution. The action or null if action not found.
method getBottomForLineNumber
getBottomForLineNumber: (lineNumber: number) => number;
Get the vertical position (top offset) for the line's bottom w.r.t. to the first line.
method getContainerDomNode
getContainerDomNode: () => HTMLElement;
Returns the editor's container dom node
method getContentHeight
getContentHeight: () => number;
Get the height of the editor's content. This is information that is "erased" when computing
scrollHeight = Math.max(contentHeight, height)
method getContentWidth
getContentWidth: () => number;
Get the width of the editor's content. This is information that is "erased" when computing
scrollWidth = Math.max(contentWidth, width)
method getContribution
getContribution: <T extends IEditorContribution>(id: string) => T | null;
Get a contribution of this editor. Unique identifier of the contribution. The contribution or null if contribution not found.
method getDecorationsInRange
getDecorationsInRange: (range: Range) => IModelDecoration[] | null;
Get all the decorations for a range (filtering out decorations from other editors).
method getDomNode
getDomNode: () => HTMLElement | null;
Returns the editor's dom node
method getLayoutInfo
getLayoutInfo: () => EditorLayoutInfo;
Get the layout info for the editor.
method getLineDecorations
getLineDecorations: (lineNumber: number) => IModelDecoration[] | null;
Get all the decorations on a line (filtering out decorations from other editors).
method getModel
getModel: () => ITextModel | null;
Type the getModel() of IEditor.
method 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.
method getOption
getOption: <T extends EditorOption>( id: T) => FindComputedEditorOptionValueById<T>;
Gets a specific editor option.
method getOptions
getOptions: () => IComputedEditorOptions;
Gets all the editor computed options.
method getRawOptions
getRawOptions: () => IEditorOptions;
Returns the editor's configuration (without any validation or defaults).
method getScrolledVisiblePosition
getScrolledVisiblePosition: ( position: IPosition) => { top: number; left: number; height: number } | 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 sameposition
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.
method getScrollHeight
getScrollHeight: () => number;
Get the scrollHeight of the editor's viewport.
method getScrollLeft
getScrollLeft: () => number;
Get the scrollLeft of the editor's viewport.
method getScrollTop
getScrollTop: () => number;
Get the scrollTop of the editor's viewport.
method getScrollWidth
getScrollWidth: () => number;
Get the scrollWidth of the editor's viewport.
method getTargetAtClientPoint
getTargetAtClientPoint: ( clientX: number, clientY: number) => IMouseTarget | null;
Get the hit test target at coordinates
clientX
andclientY
. The coordinates are relative to the top-left of the viewport.Returns
Hit test target or null if the coordinates fall outside the editor or the editor has no model.
method getTopForLineNumber
getTopForLineNumber: (lineNumber: number, includeViewZones?: boolean) => number;
Get the vertical position (top offset) for the line's top w.r.t. to the first line.
method getTopForPosition
getTopForPosition: (lineNumber: number, column: number) => number;
Get the vertical position (top offset) for the position w.r.t. to the first line.
method getValue
getValue: (options?: { preserveBOM: boolean; lineEnding: string }) => string;
Get value of the current model attached to this editor.
See Also
method getVisibleRanges
getVisibleRanges: () => Range[];
Returns the ranges that are currently visible. Does not account for horizontal scrolling.
method handleInitialized
handleInitialized: () => void;
Is called when the model has been set, view state was restored and options are updated. This is the best place to compute data for the viewport (such as tokens).
method hasPendingScrollAnimation
hasPendingScrollAnimation: () => boolean;
Check if the editor is currently scrolling towards a different scroll position.
method hasWidgetFocus
hasWidgetFocus: () => boolean;
Returns true if the text inside this editor or an editor widget has focus.
method layoutContentWidget
layoutContentWidget: (widget: IContentWidget) => void;
Layout/Reposition a content widget. This is a ping to the editor to call widget.getPosition() and update appropriately.
method layoutGlyphMarginWidget
layoutGlyphMarginWidget: (widget: IGlyphMarginWidget) => void;
Layout/Reposition a glyph margin widget. This is a ping to the editor to call widget.getPosition() and update appropriately.
method layoutOverlayWidget
layoutOverlayWidget: (widget: IOverlayWidget) => void;
Layout/Reposition an overlay widget. This is a ping to the editor to call widget.getPosition() and update appropriately.
method popUndoStop
popUndoStop: () => boolean;
Remove the "undo stop" in the undo-redo stack.
method pushUndoStop
pushUndoStop: () => boolean;
Create an "undo stop" in the undo-redo stack.
method removeContentWidget
removeContentWidget: (widget: IContentWidget) => void;
Remove a content widget.
method removeDecorations
removeDecorations: (decorationIds: string[]) => void;
Remove previously added decorations.
method removeGlyphMarginWidget
removeGlyphMarginWidget: (widget: IGlyphMarginWidget) => void;
Remove a glyph margin widget.
method removeOverlayWidget
removeOverlayWidget: (widget: IOverlayWidget) => void;
Remove an overlay widget.
method render
render: (forceRedraw?: boolean) => void;
Force an editor render now.
method restoreViewState
restoreViewState: (state: ICodeEditorViewState | null) => void;
Restores the view state of the editor from a serializable object generated by
saveViewState
.
method saveViewState
saveViewState: () => ICodeEditorViewState | null;
Saves current view state of the editor in a serializable object.
method setBanner
setBanner: (bannerDomNode: HTMLElement | null, height: number) => void;
method setModel
setModel: (model: ITextModel | null) => 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.
method setScrollLeft
setScrollLeft: (newScrollLeft: number, scrollType?: ScrollType) => void;
Change the scrollLeft of the editor's viewport.
method setScrollPosition
setScrollPosition: ( position: INewScrollPosition, scrollType?: ScrollType) => void;
Change the scroll position of the editor's viewport.
method setScrollTop
setScrollTop: (newScrollTop: number, scrollType?: ScrollType) => void;
Change the scrollTop of the editor's viewport.
method setValue
setValue: (newValue: string) => void;
Set the value of the current model attached to this editor.
See Also
method writeScreenReaderContent
writeScreenReaderContent: (reason: string) => void;
Write the screen reader content to be the current selection
interface ICodeEditorOpener
interface ICodeEditorOpener {}
Represents an object that can handle editor open operations (e.g. when "go to definition" is called with a resource other than the current model).
method openCodeEditor
openCodeEditor: ( source: ICodeEditor, resource: Uri, selectionOrPosition?: IRange | IPosition) => boolean | Promise<boolean>;
Callback that is invoked when a resource other than the current model should be opened (e.g. when "go to definition" is called). The callback should return
true
if the request was handled andfalse
otherwise.Parameter source
The code editor instance that initiated the request.
Parameter resource
The Uri of the resource that should be opened.
Parameter selectionOrPosition
An optional position or selection inside the model corresponding to
resource
that can be used to set the cursor.
interface ICodeEditorViewState
interface ICodeEditorViewState {}
A (serializable) state of the code editor.
property contributionsState
contributionsState: { [id: string]: any;};
property cursorState
cursorState: ICursorState[];
property viewState
viewState: IViewState;
interface IColorizerElementOptions
interface IColorizerElementOptions extends IColorizerOptions {}
interface IColorizerOptions
interface IColorizerOptions {}
property tabSize
tabSize?: number;
interface ICommand
interface ICommand {}
A command that modifies text / cursor state on a model.
method computeCursorState
computeCursorState: ( model: ITextModel, helper: ICursorStateComputerData) => Selection;
Compute the cursor state after the edit operations were applied.
Parameter model
The model the command has executed on.
Parameter helper
A helper to get inverse edit operations and to get previously tracked selections. The cursor state after the command executed.
method getEditOperations
getEditOperations: (model: ITextModel, builder: IEditOperationBuilder) => void;
Get the edit operations needed to execute this command.
Parameter model
The model the command will execute on.
Parameter builder
A helper to collect the needed edit operations and to track selections.
interface ICommandDescriptor
interface ICommandDescriptor {}
Description of a command contribution
interface ICommandHandler
interface ICommandHandler {}
call signature
(...args: any[]): void;
interface ICommandMetadata
interface ICommandMetadata {}
property description
readonly description: ILocalizedString | string;
interface IComputedEditorOptions
interface IComputedEditorOptions {}
All computed editor options.
method get
get: <T extends EditorOption>(id: T) => FindComputedEditorOptionValueById<T>;
interface IContentSizeChangedEvent
interface IContentSizeChangedEvent {}
property contentHeight
readonly contentHeight: number;
property contentHeightChanged
readonly contentHeightChanged: boolean;
property contentWidth
readonly contentWidth: number;
property contentWidthChanged
readonly contentWidthChanged: boolean;
interface IContentWidget
interface IContentWidget {}
A content widget renders inline with the text and can be easily placed 'near' an editor position.
property allowEditorOverflow
allowEditorOverflow?: boolean;
Render this content widget in a location where it could overflow the editor's view dom node.
property suppressMouseDown
suppressMouseDown?: boolean;
Call preventDefault() on mousedown events that target the content widget.
method afterRender
afterRender: (position: ContentWidgetPositionPreference | null) => void;
Optional function that is invoked after rendering the content widget. Is being invoked with the selected position preference or
null
if not rendered.
method beforeRender
beforeRender: () => IDimension | null;
Optional function that is invoked before rendering the content widget. If a dimension is returned the editor will attempt to use it.
method getDomNode
getDomNode: () => HTMLElement;
Get the dom node of the content widget.
method getId
getId: () => string;
Get a unique identifier of the content widget.
method getPosition
getPosition: () => IContentWidgetPosition | null;
Get the placement of the content widget. If null is returned, the content widget will be placed off screen.
interface IContentWidgetPosition
interface IContentWidgetPosition {}
A position for rendering content widgets.
property position
position: IPosition | null;
Desired position which serves as an anchor for placing the content widget. The widget will be placed above, at, or below the specified position, based on the provided preference. The widget will always touch this position.
Given sufficient horizontal space, the widget will be placed to the right of the passed in position. This can be tweaked by providing a
secondaryPosition
.See Also
preference
secondaryPosition
property positionAffinity
positionAffinity?: PositionAffinity;
Placement preference when multiple view positions refer to the same (model) position. This plays a role when injected text is involved.
property preference
preference: ContentWidgetPositionPreference[];
Placement preference for position, in order of preference.
property secondaryPosition
secondaryPosition?: IPosition | null;
Optionally, a secondary position can be provided to further define the placing of the content widget. The secondary position must have the same line number as the primary position. If possible, the widget will be placed such that it also touches the secondary position.
interface IContextKey
interface IContextKey<T extends ContextKeyValue = ContextKeyValue> {}
interface ICursorPositionChangedEvent
interface ICursorPositionChangedEvent {}
An event describing that the cursor position has changed.
property position
readonly position: Position;
Primary cursor's position.
property reason
readonly reason: CursorChangeReason;
Reason.
property secondaryPositions
readonly secondaryPositions: Position[];
Secondary cursors' position.
property source
readonly source: string;
Source of the call that caused the event.
interface ICursorSelectionChangedEvent
interface ICursorSelectionChangedEvent {}
An event describing that the cursor selection has changed.
property modelVersionId
readonly modelVersionId: number;
The model version id.
property oldModelVersionId
readonly oldModelVersionId: number;
The model version id the that
oldSelections
refer to.
property oldSelections
readonly oldSelections: Selection[] | null;
The old selections.
property reason
readonly reason: CursorChangeReason;
Reason.
property secondarySelections
readonly secondarySelections: Selection[];
The secondary selections.
property selection
readonly selection: Selection;
The primary selection.
property source
readonly source: string;
Source of the call that caused the event.
interface ICursorState
interface ICursorState {}
A (serializable) state of the cursors.
property inSelectionMode
inSelectionMode: boolean;
property position
position: IPosition;
property selectionStart
selectionStart: IPosition;
interface ICursorStateComputer
interface ICursorStateComputer {}
A callback that can compute the cursor state after applying a series of edit operations.
call signature
(inverseEditOperations: IValidEditOperation[]): Selection[] | null;
A callback that can compute the resulting cursors state after some edit operations have been executed.
interface ICursorStateComputerData
interface ICursorStateComputerData {}
A helper for computing cursor state after a command.
method getInverseEditOperations
getInverseEditOperations: () => IValidEditOperation[];
Get the inverse edit operations of the added edit operations.
method getTrackedSelection
getTrackedSelection: (id: string) => Selection;
Get a previously tracked selection.
Parameter id
The unique identifier returned by
trackSelection
. The selection.
interface IDecorationOptions
interface IDecorationOptions {}
interface IDiffEditor
interface IDiffEditor extends IEditor {}
A rich diff editor.
property onDidChangeModel
readonly onDidChangeModel: IEvent<void>;
An event emitted when the diff model is changed (i.e. the diff editor shows new content).
property onDidUpdateDiff
readonly onDidUpdateDiff: IEvent<void>;
An event emitted when the diff information computed by this diff editor has been updated.
method accessibleDiffViewerNext
accessibleDiffViewerNext: () => void;
method accessibleDiffViewerPrev
accessibleDiffViewerPrev: () => void;
method createViewModel
createViewModel: (model: IDiffEditorModel) => IDiffEditorViewModel;
method getContainerDomNode
getContainerDomNode: () => HTMLElement;
See Also
method getLineChanges
getLineChanges: () => ILineChange[] | null;
Get the computed diff information.
method getModel
getModel: () => IDiffEditorModel | null;
Type the getModel() of IEditor.
method getModifiedEditor
getModifiedEditor: () => ICodeEditor;
Get the
modified
editor.
method getOriginalEditor
getOriginalEditor: () => ICodeEditor;
Get the
original
editor.
method goToDiff
goToDiff: (target: 'next' | 'previous') => void;
Jumps to the next or previous diff.
method handleInitialized
handleInitialized: () => void;
method restoreViewState
restoreViewState: (state: IDiffEditorViewState | null) => void;
Restores the view state of the editor from a serializable object generated by
saveViewState
.
method revealFirstDiff
revealFirstDiff: () => unknown;
Scrolls to the first diff. (Waits until the diff computation finished.)
method saveViewState
saveViewState: () => IDiffEditorViewState | null;
Saves current view state of the editor in a serializable object.
method setModel
setModel: (model: IDiffEditorModel | IDiffEditorViewModel | null) => 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.
method updateOptions
updateOptions: (newOptions: IDiffEditorOptions) => void;
Update the editor's options after the editor has been created.
interface IDiffEditorBaseOptions
interface IDiffEditorBaseOptions {}
property accessibilityVerbose
accessibilityVerbose?: boolean;
Whether the diff editor aria label should be verbose.
property compactMode
compactMode?: boolean;
If set, the diff editor is optimized for small views. Defaults to
false
.
property diffAlgorithm
diffAlgorithm?: 'legacy' | 'advanced';
Diff Algorithm
property diffCodeLens
diffCodeLens?: boolean;
Should the diff editor enable code lens? Defaults to false.
property diffWordWrap
diffWordWrap?: 'off' | 'on' | 'inherit';
Control the wrapping of the diff editor.
property enableSplitViewResizing
enableSplitViewResizing?: boolean;
Allow the user to resize the diff editor split view. Defaults to true.
property experimental
experimental?: { /** * Defaults to false. */ showMoves?: boolean; showEmptyDecorations?: boolean; /** * Only applies when `renderSideBySide` is set to false. */ useTrueInlineView?: boolean;};
property hideUnchangedRegions
hideUnchangedRegions?: { enabled?: boolean; revealLineCount?: number; minimumLineCount?: number; contextLineCount?: number;};
property ignoreTrimWhitespace
ignoreTrimWhitespace?: boolean;
Compute the diff by ignoring leading/trailing whitespace Defaults to true.
property isInEmbeddedEditor
isInEmbeddedEditor?: boolean;
Is the diff editor inside another editor Defaults to false
property maxComputationTime
maxComputationTime?: number;
Timeout in milliseconds after which diff computation is cancelled. Defaults to 5000.
property maxFileSize
maxFileSize?: number;
Maximum supported file size in MB. Defaults to 50.
property onlyShowAccessibleDiffViewer
onlyShowAccessibleDiffViewer?: boolean;
If the diff editor should only show the difference review mode.
property originalEditable
originalEditable?: boolean;
Original model should be editable? Defaults to false.
property renderGutterMenu
renderGutterMenu?: boolean;
Indicates if the gutter menu should be rendered.
property renderIndicators
renderIndicators?: boolean;
Render +/- indicators for added/deleted changes. Defaults to true.
property renderMarginRevertIcon
renderMarginRevertIcon?: boolean;
Shows icons in the glyph margin to revert changes. Default to true.
property renderOverviewRuler
renderOverviewRuler?: boolean;
Is the diff editor should render overview ruler Defaults to true
property renderSideBySide
renderSideBySide?: boolean;
Render the differences in two side-by-side editors. Defaults to true.
property renderSideBySideInlineBreakpoint
renderSideBySideInlineBreakpoint?: number | undefined;
When
renderSideBySide
is enabled,useInlineViewWhenSpaceIsLimited
is set, and the diff editor has a width less thanrenderSideBySideInlineBreakpoint
, the inline view is used.
property splitViewDefaultRatio
splitViewDefaultRatio?: number;
The default ratio when rendering side-by-side editors. Must be a number between 0 and 1, min sizes apply. Defaults to 0.5
property useInlineViewWhenSpaceIsLimited
useInlineViewWhenSpaceIsLimited?: boolean;
When
renderSideBySide
is enabled,useInlineViewWhenSpaceIsLimited
is set, and the diff editor has a width less thanrenderSideBySideInlineBreakpoint
, the inline view is used.
interface IDiffEditorConstructionOptions
interface IDiffEditorConstructionOptions extends IDiffEditorOptions, IEditorConstructionOptions {}
property modifiedAriaLabel
modifiedAriaLabel?: string;
Aria label for modified editor.
property originalAriaLabel
originalAriaLabel?: string;
Aria label for original editor.
property overflowWidgetsDomNode
overflowWidgetsDomNode?: HTMLElement;
Place overflow widgets inside an external DOM node. Defaults to an internal DOM node.
interface IDiffEditorModel
interface IDiffEditorModel {}
A model for the diff editor.
interface IDiffEditorOptions
interface IDiffEditorOptions extends IEditorOptions, IDiffEditorBaseOptions {}
Configuration options for the diff editor.
interface IDiffEditorViewModel
interface IDiffEditorViewModel extends IDisposable {}
property model
readonly model: IDiffEditorModel;
method waitForDiff
waitForDiff: () => Promise<void>;
interface IDiffEditorViewState
interface IDiffEditorViewState {}
(Serializable) View state for the diff editor.
property modelState
modelState?: unknown;
property modified
modified: ICodeEditorViewState | null;
property original
original: ICodeEditorViewState | null;
interface IDimension
interface IDimension {}
interface IDropIntoEditorOptions
interface IDropIntoEditorOptions {}
Configuration options for editor drop into behavior
property enabled
enabled?: boolean;
Enable dropping into editor. Defaults to true.
property showDropSelector
showDropSelector?: 'afterDrop' | 'never';
Controls if a widget is shown after a drop. Defaults to 'afterDrop'.
interface IEditOperationBuilder
interface IEditOperationBuilder {}
A builder and helper for edit operations for a command.
method addEditOperation
addEditOperation: ( range: IRange, text: string | null, forceMoveMarkers?: boolean) => void;
Add a new edit operation (a replace operation).
Parameter range
The range to replace (delete). May be empty to represent a simple insert.
Parameter text
The text to replace with. May be null to represent a simple delete.
method addTrackedEditOperation
addTrackedEditOperation: ( range: IRange, text: string | null, forceMoveMarkers?: boolean) => void;
Add a new edit operation (a replace operation). The inverse edits will be accessible in
ICursorStateComputerData.getInverseEditOperations()
Parameter range
The range to replace (delete). May be empty to represent a simple insert.
Parameter text
The text to replace with. May be null to represent a simple delete.
method trackSelection
trackSelection: (selection: Selection, trackPreviousOnEmpty?: boolean) => string;
Track
selection
when applying edit operations. A best effort will be made to not grow/expand the selection. An empty selection will clamp to a nearby character.Parameter selection
The selection to track.
Parameter trackPreviousOnEmpty
If set, and the selection is empty, indicates whether the selection should clamp to the previous or the next character. A unique identifier.
interface IEditor
interface IEditor {}
An editor.
method createDecorationsCollection
createDecorationsCollection: ( decorations?: IModelDeltaDecoration[]) => IEditorDecorationsCollection;
Create a collection of decorations. All decorations added through this collection will get the ownerId of the editor (meaning they will not show up in other editors). These decorations will be automatically cleared when the editor's model changes.
method dispose
dispose: () => void;
Dispose the editor.
method focus
focus: () => void;
Brings browser focus to the editor text
method getEditorType
getEditorType: () => string;
Get the editor type. Please see
EditorType
. This is to avoid an instanceof check
method getId
getId: () => string;
Get a unique id for this editor instance.
method getModel
getModel: () => IEditorModel | null;
Gets the current model attached to this editor.
method getPosition
getPosition: () => Position | null;
Returns the primary position of the cursor.
method getSelection
getSelection: () => Selection | null;
Returns the primary selection of the editor.
method getSelections
getSelections: () => Selection[] | null;
Returns all the selections of the editor.
method getSupportedActions
getSupportedActions: () => IEditorAction[];
Returns all actions associated with this editor.
method getVisibleColumnFromPosition
getVisibleColumnFromPosition: (position: IPosition) => number;
Given a position, returns a column number that takes tab-widths into account.
method hasTextFocus
hasTextFocus: () => boolean;
Returns true if the text inside this editor is focused (i.e. cursor is blinking).
method layout
layout: (dimension?: IDimension, postponeRendering?: boolean) => void;
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.
By default, this will also render the editor immediately. If you prefer to delay rendering to the next animation frame, use postponeRendering == true.
method onDidDispose
onDidDispose: (listener: () => void) => IDisposable;
An event emitted when the editor has been disposed.
method restoreViewState
restoreViewState: (state: IEditorViewState | null) => void;
Restores the view state of the editor from a serializable object generated by
saveViewState
.
method revealLine
revealLine: (lineNumber: number, scrollType?: ScrollType) => void;
Scroll vertically as necessary and reveal a line.
method revealLineInCenter
revealLineInCenter: (lineNumber: number, scrollType?: ScrollType) => void;
Scroll vertically as necessary and reveal a line centered vertically.
method revealLineInCenterIfOutsideViewport
revealLineInCenterIfOutsideViewport: ( lineNumber: number, scrollType?: ScrollType) => void;
Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.
method revealLineNearTop
revealLineNearTop: (lineNumber: number, scrollType?: ScrollType) => void;
Scroll vertically as necessary and reveal a line close to the top of the viewport, optimized for viewing a code definition.
method revealLines
revealLines: ( startLineNumber: number, endLineNumber: number, scrollType?: ScrollType) => void;
Scroll vertically as necessary and reveal lines.
method revealLinesInCenter
revealLinesInCenter: ( lineNumber: number, endLineNumber: number, scrollType?: ScrollType) => void;
Scroll vertically as necessary and reveal lines centered vertically.
method revealLinesInCenterIfOutsideViewport
revealLinesInCenterIfOutsideViewport: ( lineNumber: number, endLineNumber: number, scrollType?: ScrollType) => void;
Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.
method revealLinesNearTop
revealLinesNearTop: ( lineNumber: number, endLineNumber: number, scrollType?: ScrollType) => void;
Scroll vertically as necessary and reveal lines close to the top of the viewport, optimized for viewing a code definition.
method revealPosition
revealPosition: (position: IPosition, scrollType?: ScrollType) => void;
Scroll vertically or horizontally as necessary and reveal a position.
method revealPositionInCenter
revealPositionInCenter: (position: IPosition, scrollType?: ScrollType) => void;
Scroll vertically or horizontally as necessary and reveal a position centered vertically.
method revealPositionInCenterIfOutsideViewport
revealPositionInCenterIfOutsideViewport: ( position: IPosition, scrollType?: ScrollType) => void;
Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport.
method revealPositionNearTop
revealPositionNearTop: (position: IPosition, scrollType?: ScrollType) => void;
Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport, optimized for viewing a code definition.
method revealRange
revealRange: (range: IRange, scrollType?: ScrollType) => void;
Scroll vertically or horizontally as necessary and reveal a range.
method revealRangeAtTop
revealRangeAtTop: (range: IRange, scrollType?: ScrollType) => void;
Scroll vertically or horizontally as necessary and reveal a range at the top of the viewport.
method revealRangeInCenter
revealRangeInCenter: (range: IRange, scrollType?: ScrollType) => void;
Scroll vertically or horizontally as necessary and reveal a range centered vertically.
method revealRangeInCenterIfOutsideViewport
revealRangeInCenterIfOutsideViewport: ( range: IRange, scrollType?: ScrollType) => void;
Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.
method revealRangeNearTop
revealRangeNearTop: (range: IRange, scrollType?: ScrollType) => void;
Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, optimized for viewing a code definition.
method revealRangeNearTopIfOutsideViewport
revealRangeNearTopIfOutsideViewport: ( range: IRange, scrollType?: ScrollType) => void;
Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, optimized for viewing a code definition. Only if it lies outside the viewport.
method saveViewState
saveViewState: () => IEditorViewState | null;
Saves current view state of the editor in a serializable object.
method setModel
setModel: (model: IEditorModel | null) => 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.
method setPosition
setPosition: (position: IPosition, source?: string) => void;
Set the primary position of the cursor. This will remove any secondary cursors.
Parameter position
New primary cursor's position
Parameter source
Source of the call that caused the position
method setSelection
setSelection: { (selection: IRange, source?: string): void; (selection: Range, source?: string): void; (selection: ISelection, source?: string): void; (selection: Selection, source?: string): void;};
Set the primary selection of the editor. This will remove any secondary cursors.
Parameter selection
The new selection
Parameter source
Source of the call that caused the selection
method setSelections
setSelections: (selections: readonly ISelection[], source?: string) => void;
Set the selections for all the cursors of the editor. Cursors will be removed or added, as necessary.
Parameter selections
The new selection
Parameter source
Source of the call that caused the selection
method trigger
trigger: ( source: string | null | undefined, handlerId: string, payload: any) => void;
Directly trigger a handler or an editor action.
Parameter source
The source of the call.
Parameter handlerId
The id of the handler or the id of a contribution.
Parameter payload
Extra data to be sent to the handler.
method updateOptions
updateOptions: (newOptions: IEditorOptions) => void;
Update the editor's options after the editor has been created.
interface IEditorAction
interface IEditorAction {}
interface IEditorCommentsOptions
interface IEditorCommentsOptions {}
Configuration options for editor comments
property ignoreEmptyLines
ignoreEmptyLines?: boolean;
Ignore empty lines when inserting line comments. Defaults to true.
property insertSpace
insertSpace?: boolean;
Insert a space after the line comment token and inside the block comments tokens. Defaults to true.
interface IEditorConstructionOptions
interface IEditorConstructionOptions extends IEditorOptions {}
property dimension
dimension?: IDimension;
The initial editor dimension (to avoid measuring the container).
property overflowWidgetsDomNode
overflowWidgetsDomNode?: HTMLElement;
Place overflow widgets inside an external DOM node. Defaults to an internal DOM node.
interface IEditorContribution
interface IEditorContribution {}
An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed.
method dispose
dispose: () => void;
Dispose this contribution.
method restoreViewState
restoreViewState: (state: any) => void;
Restore view state.
method saveViewState
saveViewState: () => any;
Store view state.
interface IEditorDecorationsCollection
interface IEditorDecorationsCollection {}
A collection of decorations
property length
length: number;
Get the decorations count.
property onDidChange
onDidChange: IEvent<IModelDecorationsChangedEvent>;
An event emitted when decorations change in the editor, but the change is not caused by us setting or clearing the collection.
method append
append: (newDecorations: readonly IModelDeltaDecoration[]) => string[];
Append
newDecorations
to this collection.
method clear
clear: () => void;
Remove all previous decorations.
method getRange
getRange: (index: number) => Range | null;
Get the range for a decoration.
method getRanges
getRanges: () => Range[];
Get all ranges for decorations.
method has
has: (decoration: IModelDecoration) => boolean;
Determine if a decoration is in this collection.
method set
set: (newDecorations: readonly IModelDeltaDecoration[]) => string[];
Replace all previous decorations with
newDecorations
.
interface IEditorFindOptions
interface IEditorFindOptions {}
Configuration options for editor find widget
property addExtraSpaceOnTop
addExtraSpaceOnTop?: boolean;
property autoFindInSelection
autoFindInSelection?: 'never' | 'always' | 'multiline';
Controls if Find in Selection flag is turned on in the editor.
property cursorMoveOnType
cursorMoveOnType?: boolean;
Controls whether the cursor should move to find matches while typing.
property loop
loop?: boolean;
Controls whether the search result and diff result automatically restarts from the beginning (or the end) when no further matches can be found
property seedSearchStringFromSelection
seedSearchStringFromSelection?: 'never' | 'always' | 'selection';
Controls if we seed search string in the Find Widget with editor selection.
interface IEditorHoverOptions
interface IEditorHoverOptions {}
Configuration options for editor hover
property above
above?: boolean;
Should the hover be shown above the line if possible? Defaults to false.
property delay
delay?: number;
Delay for showing the hover. Defaults to 300.
property enabled
enabled?: boolean;
Enable the hover. Defaults to true.
property hidingDelay
hidingDelay?: number;
Controls how long the hover is visible after you hovered out of it. Require sticky setting to be true.
property sticky
sticky?: boolean;
Is the hover sticky such that it can be clicked and its contents selected? Defaults to true.
interface IEditorInlayHintsOptions
interface IEditorInlayHintsOptions {}
Configuration options for editor inlayHints
property enabled
enabled?: 'on' | 'off' | 'offUnlessPressed' | 'onUnlessPressed';
Enable the inline hints. Defaults to true.
property fontFamily
fontFamily?: string;
Font family of inline hints. Defaults to editor font family.
property fontSize
fontSize?: number;
Font size of inline hints. Default to 90% of the editor font size.
property padding
padding?: boolean;
Enables the padding around the inlay hint. Defaults to false.
interface IEditorLightbulbOptions
interface IEditorLightbulbOptions {}
Configuration options for editor lightbulb
property enabled
enabled?: ShowLightbulbIconMode;
Enable the lightbulb code action. The three possible values are
off
,on
andonCode
and the default isonCode
.off
disables the code action menu.on
shows the code action menu on code and on empty lines.onCode
shows the code action menu on code only.
interface IEditorMinimapOptions
interface IEditorMinimapOptions {}
Configuration options for editor minimap
property autohide
autohide?: boolean;
Control the rendering of minimap.
property enabled
enabled?: boolean;
Enable the rendering of the minimap. Defaults to true.
property maxColumn
maxColumn?: number;
Limit the width of the minimap to render at most a certain number of columns. Defaults to 120.
property renderCharacters
renderCharacters?: boolean;
Render the actual text on a line (as opposed to color blocks). Defaults to true.
property scale
scale?: number;
Relative size of the font in the minimap. Defaults to 1.
property sectionHeaderFontSize
sectionHeaderFontSize?: number;
Font size of section headers. Defaults to 9.
property sectionHeaderLetterSpacing
sectionHeaderLetterSpacing?: number;
Spacing between the section header characters (in CSS px). Defaults to 1.
property showMarkSectionHeaders
showMarkSectionHeaders?: boolean;
Whether to show MARK: comments as section headers. Defaults to true.
property showRegionSectionHeaders
showRegionSectionHeaders?: boolean;
Whether to show named regions as section headers. Defaults to true.
property showSlider
showSlider?: 'always' | 'mouseover';
Control the rendering of the minimap slider. Defaults to 'mouseover'.
property side
side?: 'right' | 'left';
Control the side of the minimap in editor. Defaults to 'right'.
property size
size?: 'proportional' | 'fill' | 'fit';
Control the minimap rendering mode. Defaults to 'actual'.
interface IEditorMouseEvent
interface IEditorMouseEvent {}
A mouse event originating from the editor.
interface IEditorOption
interface IEditorOption<K extends EditorOption, V> {}
property defaultValue
defaultValue: V;
property id
readonly id: K;
property name
readonly name: string;
method applyUpdate
applyUpdate: (value: V | undefined, update: V) => ApplyUpdateResult<V>;
Might modify
value
.
interface IEditorOptions
interface IEditorOptions {}
Configuration options for the editor.
property acceptSuggestionOnCommitCharacter
acceptSuggestionOnCommitCharacter?: boolean;
Accept suggestions on provider defined characters. Defaults to true.
property acceptSuggestionOnEnter
acceptSuggestionOnEnter?: 'on' | 'smart' | 'off';
Accept suggestions on ENTER. Defaults to 'on'.
property accessibilityPageSize
accessibilityPageSize?: number;
Controls the number of lines in the editor that can be read out by a screen reader
property accessibilitySupport
accessibilitySupport?: 'auto' | 'off' | 'on';
Configure the editor's accessibility support. Defaults to 'auto'. It is best to leave this to 'auto'.
property ariaLabel
ariaLabel?: string;
The aria label for the editor's textarea (when it is focused).
property ariaRequired
ariaRequired?: boolean;
Whether the aria-required attribute should be set on the editors textarea.
property autoClosingBrackets
autoClosingBrackets?: EditorAutoClosingStrategy;
Options for auto closing brackets. Defaults to language defined behavior.
property autoClosingComments
autoClosingComments?: EditorAutoClosingStrategy;
Options for auto closing comments. Defaults to language defined behavior.
property autoClosingDelete
autoClosingDelete?: EditorAutoClosingEditStrategy;
Options for pressing backspace near quotes or bracket pairs.
property autoClosingOvertype
autoClosingOvertype?: EditorAutoClosingEditStrategy;
Options for typing over closing quotes or brackets.
property autoClosingQuotes
autoClosingQuotes?: EditorAutoClosingStrategy;
Options for auto closing quotes. Defaults to language defined behavior.
property autoIndent
autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full';
Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines. Defaults to advanced.
property automaticLayout
automaticLayout?: boolean;
Enable that the editor will install a ResizeObserver to check if its container dom node size has changed. Defaults to false.
property autoSurround
autoSurround?: EditorAutoSurroundStrategy;
Options for auto surrounding. Defaults to always allowing auto surrounding.
property bracketPairColorization
bracketPairColorization?: IBracketPairColorizationOptions;
Configures bracket pair colorization (disabled by default).
property codeActionsOnSaveTimeout
codeActionsOnSaveTimeout?: number;
Timeout for running code actions on save.
property codeLens
codeLens?: boolean;
Show code lens Defaults to true.
property codeLensFontFamily
codeLensFontFamily?: string;
Code lens font family. Defaults to editor font family.
property codeLensFontSize
codeLensFontSize?: number;
Code lens font size. Default to 90% of the editor font size
property colorDecorators
colorDecorators?: boolean;
Enable inline color decorators and color picker rendering.
property colorDecoratorsActivatedOn
colorDecoratorsActivatedOn?: 'clickAndHover' | 'click' | 'hover';
Controls what is the condition to spawn a color picker from a color dectorator
property colorDecoratorsLimit
colorDecoratorsLimit?: number;
Controls the max number of color decorators that can be rendered in an editor at once.
property columnSelection
columnSelection?: boolean;
Enable that the selection with the mouse and keys is doing column selection. Defaults to false.
property comments
comments?: IEditorCommentsOptions;
Control the behaviour of comments in the editor.
property contextmenu
contextmenu?: boolean;
Enable custom contextmenu. Defaults to true.
property copyWithSyntaxHighlighting
copyWithSyntaxHighlighting?: boolean;
Syntax highlighting is copied.
property cursorBlinking
cursorBlinking?: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid';
Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'. Defaults to 'blink'.
property cursorSmoothCaretAnimation
cursorSmoothCaretAnimation?: 'off' | 'explicit' | 'on';
Enable smooth caret animation. Defaults to 'off'.
property cursorStyle
cursorStyle?: | 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin';
Control the cursor style, either 'block' or 'line'. Defaults to 'line'.
property cursorSurroundingLines
cursorSurroundingLines?: number;
Controls the minimal number of visible leading and trailing lines surrounding the cursor. Defaults to 0.
property cursorSurroundingLinesStyle
cursorSurroundingLinesStyle?: 'default' | 'all';
Controls when
cursorSurroundingLines
should be enforced Defaults todefault
,cursorSurroundingLines
is not enforced when cursor position is changed by mouse.
property cursorWidth
cursorWidth?: number;
Control the width of the cursor when cursorStyle is set to 'line'
property defaultColorDecorators
defaultColorDecorators?: boolean;
Controls whether to use default color decorations or not using the default document color provider
property definitionLinkOpensInPeek
definitionLinkOpensInPeek?: boolean;
Controls whether the definition link opens element in the peek widget. Defaults to false.
property disableLayerHinting
disableLayerHinting?: boolean;
Disable the use of
transform: translate3d(0px, 0px, 0px)
for the editor margin and lines layers. The usage oftransform: translate3d(0px, 0px, 0px)
acts as a hint for browsers to create an extra layer. Defaults to false.
property disableMonospaceOptimizations
disableMonospaceOptimizations?: boolean;
Disable the optimizations for monospace fonts. Defaults to false.
property domReadOnly
domReadOnly?: boolean;
Should the textarea used for input use the DOM
readonly
attribute. Defaults to false.
property dragAndDrop
dragAndDrop?: boolean;
Controls if the editor should allow to move selections via drag and drop. Defaults to false.
property dropIntoEditor
dropIntoEditor?: IDropIntoEditorOptions;
Controls dropping into the editor from an external source.
When enabled, this shows a preview of the drop location and triggers an
onDropIntoEditor
event.
property emptySelectionClipboard
emptySelectionClipboard?: boolean;
Copying without a selection copies the current line.
property experimentalInlineEdit
experimentalInlineEdit?: IInlineEditOptions;
property experimentalWhitespaceRendering
experimentalWhitespaceRendering?: 'svg' | 'font' | 'off';
Enable experimental whitespace rendering. Defaults to 'svg'.
property extraEditorClassName
extraEditorClassName?: string;
Class name to be added to the editor.
property fastScrollSensitivity
fastScrollSensitivity?: number;
FastScrolling mulitplier speed when pressing
Alt
Defaults to 5.
property find
find?: IEditorFindOptions;
Control the behavior of the find widget.
property fixedOverflowWidgets
fixedOverflowWidgets?: boolean;
Display overflow widgets as
fixed
. Defaults tofalse
.
property folding
folding?: boolean;
Enable code folding. Defaults to true.
property foldingHighlight
foldingHighlight?: boolean;
Enable highlight for folded regions. Defaults to true.
property foldingImportsByDefault
foldingImportsByDefault?: boolean;
Auto fold imports folding regions. Defaults to true.
property foldingMaximumRegions
foldingMaximumRegions?: number;
Maximum number of foldable regions. Defaults to 5000.
property foldingStrategy
foldingStrategy?: 'auto' | 'indentation';
Selects the folding strategy. 'auto' uses the strategies contributed for the current document, 'indentation' uses the indentation based folding strategy. Defaults to 'auto'.
property fontFamily
fontFamily?: string;
The font family
property fontLigatures
fontLigatures?: boolean | string;
Enable font ligatures. Defaults to false.
property fontSize
fontSize?: number;
The font size
property fontVariations
fontVariations?: boolean | string;
Enable font variations. Defaults to false.
property fontWeight
fontWeight?: string;
The font weight
property formatOnPaste
formatOnPaste?: boolean;
Enable format on paste. Defaults to false.
property formatOnType
formatOnType?: boolean;
Enable format on type. Defaults to false.
property glyphMargin
glyphMargin?: boolean;
Enable the rendering of the glyph margin. Defaults to true in vscode and to false in monaco-editor.
property gotoLocation
gotoLocation?: IGotoLocationOptions;
property guides
guides?: IGuidesOptions;
Controls the behavior of editor guides.
property hideCursorInOverviewRuler
hideCursorInOverviewRuler?: boolean;
Should the cursor be hidden in the overview ruler. Defaults to false.
property hover
hover?: IEditorHoverOptions;
Configure the editor's hover.
property inDiffEditor
inDiffEditor?: boolean;
This editor is used inside a diff editor.
property inlayHints
inlayHints?: IEditorInlayHintsOptions;
Control the behavior and rendering of the inline hints.
property inlineCompletionsAccessibilityVerbose
inlineCompletionsAccessibilityVerbose?: boolean;
Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.
property inlineSuggest
inlineSuggest?: IInlineSuggestOptions;
property letterSpacing
letterSpacing?: number;
The letter spacing
property lightbulb
lightbulb?: IEditorLightbulbOptions;
Control the behavior and rendering of the code action lightbulb.
property lineDecorationsWidth
lineDecorationsWidth?: number | string;
The width reserved for line decorations (in px). Line decorations are placed between line numbers and the editor content. You can pass in a string in the format floating point followed by "ch". e.g. 1.3ch. Defaults to 10.
property lineHeight
lineHeight?: number;
The line height
property lineNumbers
lineNumbers?: LineNumbersType;
Control the rendering of line numbers. If it is a function, it will be invoked when rendering a line number and the return value will be rendered. Otherwise, if it is a truthy, line numbers will be rendered normally (equivalent of using an identity function). Otherwise, line numbers will not be rendered. Defaults to
on
.
property lineNumbersMinChars
lineNumbersMinChars?: number;
Control the width of line numbers, by reserving horizontal space for rendering at least an amount of digits. Defaults to 5.
property linkedEditing
linkedEditing?: boolean;
Enable linked editing. Defaults to false.
property links
links?: boolean;
Enable detecting links and making them clickable. Defaults to true.
property matchBrackets
matchBrackets?: 'never' | 'near' | 'always';
Enable highlighting of matching brackets. Defaults to 'always'.
property matchOnWordStartOnly
matchOnWordStartOnly?: boolean;
Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
property minimap
minimap?: IEditorMinimapOptions;
Control the behavior and rendering of the minimap.
property mouseStyle
mouseStyle?: 'text' | 'default' | 'copy';
Control the mouse pointer style, either 'text' or 'default' or 'copy' Defaults to 'text'
property mouseWheelScrollSensitivity
mouseWheelScrollSensitivity?: number;
A multiplier to be used on the
deltaX
anddeltaY
of mouse wheel scroll events. Defaults to 1.
property mouseWheelZoom
mouseWheelZoom?: boolean;
Zoom the font in the editor when using the mouse wheel in combination with holding Ctrl. Defaults to false.
property multiCursorLimit
multiCursorLimit?: number;
Controls the max number of text cursors that can be in an active editor at once.
property multiCursorMergeOverlapping
multiCursorMergeOverlapping?: boolean;
Merge overlapping selections. Defaults to true
property multiCursorModifier
multiCursorModifier?: 'ctrlCmd' | 'alt';
The modifier to be used to add multiple cursors with the mouse. Defaults to 'alt'
property multiCursorPaste
multiCursorPaste?: 'spread' | 'full';
Configure the behaviour when pasting a text with the line count equal to the cursor count. Defaults to 'spread'.
property occurrencesHighlight
occurrencesHighlight?: 'off' | 'singleFile' | 'multiFile';
Enable semantic occurrences highlight. Defaults to 'singleFile'. 'off' disables occurrence highlighting 'singleFile' triggers occurrence highlighting in the current document 'multiFile' triggers occurrence highlighting across valid open documents
property overviewRulerBorder
overviewRulerBorder?: boolean;
Controls if a border should be drawn around the overview ruler. Defaults to
true
.
property overviewRulerLanes
overviewRulerLanes?: number;
The number of vertical lanes the overview ruler should render. Defaults to 3.
property padding
padding?: IEditorPaddingOptions;
Controls the spacing around the editor.
property parameterHints
parameterHints?: IEditorParameterHintOptions;
Parameter hint options.
property pasteAs
pasteAs?: IPasteAsOptions;
Controls support for changing how content is pasted into the editor.
property peekWidgetDefaultFocus
peekWidgetDefaultFocus?: 'tree' | 'editor';
Controls whether to focus the inline editor in the peek widget by default. Defaults to false.
property placeholder
placeholder?: string | undefined;
Sets a placeholder for the editor. If set, the placeholder is shown if the editor is empty.
property quickSuggestions
quickSuggestions?: boolean | IQuickSuggestionsOptions;
Enable quick suggestions (shadow suggestions) Defaults to true.
property quickSuggestionsDelay
quickSuggestionsDelay?: number;
Quick suggestions show delay (in ms) Defaults to 10 (ms)
property readOnly
readOnly?: boolean;
Should the editor be read only. See also
domReadOnly
. Defaults to false.
property readOnlyMessage
readOnlyMessage?: IMarkdownString;
The message to display when the editor is readonly.
property renameOnType
renameOnType?: boolean;
deprecated, use linkedEditing instead
property renderControlCharacters
renderControlCharacters?: boolean;
Enable rendering of control characters. Defaults to true.
property renderFinalNewline
renderFinalNewline?: 'on' | 'off' | 'dimmed';
Render last line number when the file ends with a newline. Defaults to 'on' for Windows and macOS and 'dimmed' for Linux.
property renderLineHighlight
renderLineHighlight?: 'none' | 'gutter' | 'line' | 'all';
Enable rendering of current line highlight. Defaults to all.
property renderLineHighlightOnlyWhenFocus
renderLineHighlightOnlyWhenFocus?: boolean;
Control if the current line highlight should be rendered only the editor is focused. Defaults to false.
property renderValidationDecorations
renderValidationDecorations?: 'editable' | 'on' | 'off';
Should the editor render validation decorations. Defaults to editable.
property renderWhitespace
renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all';
Enable rendering of whitespace. Defaults to 'selection'.
property revealHorizontalRightPadding
revealHorizontalRightPadding?: number;
When revealing the cursor, a virtual padding (px) is added to the cursor, turning it into a rectangle. This virtual padding ensures that the cursor gets revealed before hitting the edge of the viewport. Defaults to 30 (px).
property roundedSelection
roundedSelection?: boolean;
Render the editor selection with rounded borders. Defaults to true.
property rulers
rulers?: (number | IRulerOption)[];
Render vertical lines at the specified columns. Defaults to empty array.
property screenReaderAnnounceInlineSuggestion
screenReaderAnnounceInlineSuggestion?: boolean;
Control whether a screen reader announces inline suggestion content immediately.
property scrollbar
scrollbar?: IEditorScrollbarOptions;
Control the behavior and rendering of the scrollbars.
property scrollBeyondLastColumn
scrollBeyondLastColumn?: number;
Enable that scrolling can go beyond the last column by a number of columns. Defaults to 5.
property scrollBeyondLastLine
scrollBeyondLastLine?: boolean;
Enable that scrolling can go one screen size after the last line. Defaults to true.
property scrollPredominantAxis
scrollPredominantAxis?: boolean;
Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad. Defaults to true.
property selectionClipboard
selectionClipboard?: boolean;
Enable Linux primary clipboard. Defaults to true.
property selectionHighlight
selectionHighlight?: boolean;
Enable selection highlight. Defaults to true.
property selectOnLineNumbers
selectOnLineNumbers?: boolean;
Should the corresponding line be selected when clicking on the line number? Defaults to true.
property showDeprecated
showDeprecated?: boolean;
Controls strikethrough deprecated variables.
property showFoldingControls
showFoldingControls?: 'always' | 'never' | 'mouseover';
Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter. Defaults to 'mouseover'.
property showUnused
showUnused?: boolean;
Controls fading out of unused variables.
property smartSelect
smartSelect?: ISmartSelectOptions;
Smart select options.
property smoothScrolling
smoothScrolling?: boolean;
Enable that the editor animates scrolling to a position. Defaults to false.
property snippetSuggestions
snippetSuggestions?: 'top' | 'bottom' | 'inline' | 'none';
Enable snippet suggestions. Default to 'true'.
property stickyScroll
stickyScroll?: IEditorStickyScrollOptions;
Control the behavior of sticky scroll options
property stickyTabStops
stickyTabStops?: boolean;
Emulate selection behaviour of tab characters when using spaces for indentation. This means selection will stick to tab stops.
property stopRenderingLineAfter
stopRenderingLineAfter?: number;
Performance guard: Stop rendering a line after x characters. Defaults to 10000. Use -1 to never stop rendering
property suggest
suggest?: ISuggestOptions;
Suggest options.
property suggestFontSize
suggestFontSize?: number;
The font size for the suggest widget. Defaults to the editor font size.
property suggestLineHeight
suggestLineHeight?: number;
The line height for the suggest widget. Defaults to the editor line height.
property suggestOnTriggerCharacters
suggestOnTriggerCharacters?: boolean;
Enable the suggestion box to pop-up on trigger characters. Defaults to true.
property suggestSelection
suggestSelection?: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';
The history mode for suggestions.
property tabCompletion
tabCompletion?: 'on' | 'off' | 'onlySnippets';
Enable tab completion.
property tabFocusMode
tabFocusMode?: boolean;
Controls whether the editor / terminal receives tabs or defers them to the workbench for navigation.
property tabIndex
tabIndex?: number;
The
tabindex
property of the editor's textarea
property unfoldOnClickAfterEndOfLine
unfoldOnClickAfterEndOfLine?: boolean;
Controls whether clicking on the empty content after a folded line will unfold the line. Defaults to false.
property unicodeHighlight
unicodeHighlight?: IUnicodeHighlightOptions;
Controls the behavior of the unicode highlight feature (by default, ambiguous and invisible characters are highlighted).
property unusualLineTerminators
unusualLineTerminators?: 'auto' | 'off' | 'prompt';
Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS). Defaults to 'prompt'.
property useShadowDOM
useShadowDOM?: boolean;
Control if the editor should use shadow DOM.
property useTabStops
useTabStops?: boolean;
Inserting and deleting whitespace follows tab stops.
property wordBreak
wordBreak?: 'normal' | 'keepAll';
Sets whether line breaks appear wherever the text would otherwise overflow its content box. When wordBreak = 'normal', Use the default line break rule. When wordBreak = 'keepAll', Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.
property wordSegmenterLocales
wordSegmenterLocales?: string | string[];
Locales used for segmenting lines into words when doing word related navigations or operations.
Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.). Defaults to empty array
property wordSeparators
wordSeparators?: string;
A string containing the word separators used when doing word navigation. Defaults to `~!@#$%^&*()-=+[{]}\|;:'",.<>/?
property wordWrap
wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded';
Control the wrapping of the editor. When
wordWrap
= "off", the lines will never wrap. WhenwordWrap
= "on", the lines will wrap at the viewport width. WhenwordWrap
= "wordWrapColumn", the lines will wrap atwordWrapColumn
. WhenwordWrap
= "bounded", the lines will wrap at min(viewport width, wordWrapColumn). Defaults to "off".
property wordWrapBreakAfterCharacters
wordWrapBreakAfterCharacters?: string;
Configure word wrapping characters. A break will be introduced after these characters.
property wordWrapBreakBeforeCharacters
wordWrapBreakBeforeCharacters?: string;
Configure word wrapping characters. A break will be introduced before these characters.
property wordWrapColumn
wordWrapColumn?: number;
Control the wrapping of the editor. When
wordWrap
= "off", the lines will never wrap. WhenwordWrap
= "on", the lines will wrap at the viewport width. WhenwordWrap
= "wordWrapColumn", the lines will wrap atwordWrapColumn
. WhenwordWrap
= "bounded", the lines will wrap at min(viewport width, wordWrapColumn). Defaults to 80.
property wordWrapOverride1
wordWrapOverride1?: 'off' | 'on' | 'inherit';
Override the
wordWrap
setting.
property wordWrapOverride2
wordWrapOverride2?: 'off' | 'on' | 'inherit';
Override the
wordWrapOverride1
setting.
property wrappingIndent
wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent';
Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'. Defaults to 'same' in vscode and to 'none' in monaco-editor.
property wrappingStrategy
wrappingStrategy?: 'simple' | 'advanced';
Controls the wrapping strategy to use. Defaults to 'simple'.
interface IEditorOverrideServices
interface IEditorOverrideServices {}
index signature
[index: string]: any;
interface IEditorPaddingOptions
interface IEditorPaddingOptions {}
Configuration options for editor padding
interface IEditorParameterHintOptions
interface IEditorParameterHintOptions {}
Configuration options for parameter hints
interface IEditorScrollbarOptions
interface IEditorScrollbarOptions {}
Configuration options for editor scrollbars
property alwaysConsumeMouseWheel
alwaysConsumeMouseWheel?: boolean;
Always consume mouse wheel events (always call preventDefault() and stopPropagation() on the browser events). Defaults to true. **NOTE**: This option cannot be updated using
updateOptions()
property arrowSize
arrowSize?: number;
The size of arrows (if displayed). Defaults to 11. **NOTE**: This option cannot be updated using
updateOptions()
property handleMouseWheel
handleMouseWheel?: boolean;
Listen to mouse wheel events and react to them by scrolling. Defaults to true.
property horizontal
horizontal?: 'auto' | 'visible' | 'hidden';
Render horizontal scrollbar. Defaults to 'auto'.
property horizontalHasArrows
horizontalHasArrows?: boolean;
Render arrows at the left and right of the horizontal scrollbar. Defaults to false. **NOTE**: This option cannot be updated using
updateOptions()
property horizontalScrollbarSize
horizontalScrollbarSize?: number;
Height in pixels for the horizontal scrollbar. Defaults to 10 (px).
property horizontalSliderSize
horizontalSliderSize?: number;
Height in pixels for the horizontal slider. Defaults to
horizontalScrollbarSize
. **NOTE**: This option cannot be updated usingupdateOptions()
property ignoreHorizontalScrollbarInContentHeight
ignoreHorizontalScrollbarInContentHeight?: boolean;
When set, the horizontal scrollbar will not increase content height. Defaults to false.
property scrollByPage
scrollByPage?: boolean;
Scroll gutter clicks move by page vs jump to position. Defaults to false.
property useShadows
useShadows?: boolean;
Cast horizontal and vertical shadows when the content is scrolled. Defaults to true. **NOTE**: This option cannot be updated using
updateOptions()
property vertical
vertical?: 'auto' | 'visible' | 'hidden';
Render vertical scrollbar. Defaults to 'auto'.
property verticalHasArrows
verticalHasArrows?: boolean;
Render arrows at the top and bottom of the vertical scrollbar. Defaults to false. **NOTE**: This option cannot be updated using
updateOptions()
property verticalScrollbarSize
verticalScrollbarSize?: number;
Width in pixels for the vertical scrollbar. Defaults to 10 (px).
property verticalSliderSize
verticalSliderSize?: number;
Width in pixels for the vertical slider. Defaults to
verticalScrollbarSize
. **NOTE**: This option cannot be updated usingupdateOptions()
interface IEditorStickyScrollOptions
interface IEditorStickyScrollOptions {}
property defaultModel
defaultModel?: 'outlineModel' | 'foldingProviderModel' | 'indentationModel';
Model to choose for sticky scroll by default
property enabled
enabled?: boolean;
Enable the sticky scroll
property maxLineCount
maxLineCount?: number;
Maximum number of sticky lines to show
property scrollWithEditor
scrollWithEditor?: boolean;
Define whether to scroll sticky scroll with editor horizontal scrollbae
interface IEditorZoom
interface IEditorZoom {}
property onDidChangeZoomLevel
onDidChangeZoomLevel: IEvent<number>;
method getZoomLevel
getZoomLevel: () => number;
method setZoomLevel
setZoomLevel: (zoomLevel: number) => void;
interface IGlobalEditorOptions
interface IGlobalEditorOptions {}
Options which apply for all editors.
property 'semanticHighlighting.enabled'
'semanticHighlighting.enabled'?: true | false | 'configuredByTheme';
Controls whether the semanticHighlighting is shown for the languages that support it. true: semanticHighlighting is enabled for all themes false: semanticHighlighting is disabled for all themes 'configuredByTheme': semanticHighlighting is controlled by the current color theme's semanticHighlighting setting. Defaults to 'byTheme'.
property autoDetectHighContrast
autoDetectHighContrast?: boolean;
If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. Defaults to true.
property detectIndentation
detectIndentation?: boolean;
Controls whether
tabSize
andinsertSpaces
will be automatically detected when a file is opened based on the file contents. Defaults to true.
property insertSpaces
insertSpaces?: boolean;
Insert spaces when pressing
Tab
. This setting is overridden based on the file contents whendetectIndentation
is on. Defaults to true.
property largeFileOptimizations
largeFileOptimizations?: boolean;
Special handling for large files to disable certain memory intensive features. Defaults to true.
property maxTokenizationLineLength
maxTokenizationLineLength?: number;
Lines above this length will not be tokenized for performance reasons. Defaults to 20000.
property stablePeek
stablePeek?: boolean;
Keep peek editors open even when double-clicking their content or when hitting
Escape
. Defaults to false.
property tabSize
tabSize?: number;
The number of spaces a tab is equal to. This setting is overridden based on the file contents when
detectIndentation
is on. Defaults to 4.
property theme
theme?: string;
Theme to be used for rendering. The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black', 'hc-light'. You can create custom themes via
monaco.editor.defineTheme
. To switch a theme, usemonaco.editor.setTheme
. **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unlessautoDetectHighContrast
is set to false.
property trimAutoWhitespace
trimAutoWhitespace?: boolean;
Remove trailing auto inserted whitespace. Defaults to true.
property wordBasedSuggestions
wordBasedSuggestions?: | 'off' | 'currentDocument' | 'matchingDocuments' | 'allDocuments';
Controls whether completions should be computed based on words in the document. Defaults to true.
property wordBasedSuggestionsOnlySameLanguage
wordBasedSuggestionsOnlySameLanguage?: boolean;
Controls whether word based completions should be included from opened documents of the same language or any language.
interface IGlyphMarginLanesModel
interface IGlyphMarginLanesModel {}
property requiredLanes
readonly requiredLanes: number;
The number of lanes that should be rendered in the editor.
method getLanesAtLine
getLanesAtLine: (lineNumber: number) => GlyphMarginLane[];
Gets the lanes that should be rendered starting at a given line number.
method push
push: (lane: GlyphMarginLane, range: Range, persist?: boolean) => void;
Registers that a lane should be visible at the Range in the model.
Parameter persist
if true, notes that the lane should always be visible, even on lines where there's no specific request for that lane.
method reset
reset: (maxLine: number) => void;
Resets the model and ensures it can contain at least
maxLine
lines.
interface IGlyphMarginWidget
interface IGlyphMarginWidget {}
A glyph margin widget renders in the editor glyph margin.
method getDomNode
getDomNode: () => HTMLElement;
Get the dom node of the glyph widget.
method getId
getId: () => string;
Get a unique identifier of the glyph widget.
method getPosition
getPosition: () => IGlyphMarginWidgetPosition;
Get the placement of the glyph widget.
interface IGlyphMarginWidgetPosition
interface IGlyphMarginWidgetPosition {}
A position for rendering glyph margin widgets.
interface IGotoLocationOptions
interface IGotoLocationOptions {}
Configuration options for go to location
property alternativeDeclarationCommand
alternativeDeclarationCommand?: string;
property alternativeDefinitionCommand
alternativeDefinitionCommand?: string;
property alternativeImplementationCommand
alternativeImplementationCommand?: string;
property alternativeReferenceCommand
alternativeReferenceCommand?: string;
property alternativeTestsCommand
alternativeTestsCommand?: string;
property alternativeTypeDefinitionCommand
alternativeTypeDefinitionCommand?: string;
property multiple
multiple?: GoToLocationValues;
property multipleDeclarations
multipleDeclarations?: GoToLocationValues;
property multipleDefinitions
multipleDefinitions?: GoToLocationValues;
property multipleImplementations
multipleImplementations?: GoToLocationValues;
property multipleReferences
multipleReferences?: GoToLocationValues;
property multipleTests
multipleTests?: GoToLocationValues;
property multipleTypeDefinitions
multipleTypeDefinitions?: GoToLocationValues;
interface IGuidesOptions
interface IGuidesOptions {}
property bracketPairs
bracketPairs?: boolean | 'active';
Enable rendering of bracket pair guides. Defaults to false.
property bracketPairsHorizontal
bracketPairsHorizontal?: boolean | 'active';
Enable rendering of vertical bracket pair guides. Defaults to 'active'.
property highlightActiveBracketPair
highlightActiveBracketPair?: boolean;
Enable highlighting of the active bracket pair. Defaults to true.
property highlightActiveIndentation
highlightActiveIndentation?: boolean | 'always';
Enable highlighting of the active indent guide. Defaults to true.
property indentation
indentation?: boolean;
Enable rendering of indent guides. Defaults to true.
interface IIdentifiedSingleEditOperation
interface IIdentifiedSingleEditOperation extends ISingleEditOperation {}
A single edit operation, that has an identifier.
interface IInlineEditOptions
interface IInlineEditOptions {}
property enabled
enabled?: boolean;
Enable or disable the rendering of automatic inline edit.
property fontFamily
fontFamily?: string | 'default';
Font family for inline suggestions.
property keepOnBlur
keepOnBlur?: boolean;
Does not clear active inline suggestions when the editor loses focus.
property showToolbar
showToolbar?: 'always' | 'onHover' | 'never';
interface IInlineSuggestOptions
interface IInlineSuggestOptions {}
property enabled
enabled?: boolean;
Enable or disable the rendering of automatic inline completions.
property fontFamily
fontFamily?: string | 'default';
Font family for inline suggestions.
property keepOnBlur
keepOnBlur?: boolean;
Does not clear active inline suggestions when the editor loses focus.
property mode
mode?: 'prefix' | 'subword' | 'subwordSmart';
Configures the mode. Use
prefix
to only show ghost text if the text to replace is a prefix of the suggestion text. Usesubword
to only show ghost text if the replace text is a subword of the suggestion text. UsesubwordSmart
to only show ghost text if the replace text is a subword of the suggestion text, but the subword must start after the cursor position. Defaults toprefix
.
property showToolbar
showToolbar?: 'always' | 'onHover' | 'never';
property suppressSuggestions
suppressSuggestions?: boolean;
interface IKeybindingRule
interface IKeybindingRule {}
A keybinding rule.
property command
command?: string | null;
property commandArgs
commandArgs?: any;
property keybinding
keybinding: number;
property when
when?: string | null;
interface ILineChange
interface ILineChange extends IChange {}
A line change
property charChanges
readonly charChanges: ICharChange[] | undefined;
interface ILinkOpener
interface ILinkOpener {}
method open
open: (resource: Uri) => boolean | Promise<boolean>;
interface ILocalizedString
interface ILocalizedString {}
interface IMarker
interface IMarker {}
property code
code?: | string | { value: string; target: Uri; };
property endColumn
endColumn: number;
property endLineNumber
endLineNumber: number;
property message
message: string;
property modelVersionId
modelVersionId?: number;
property owner
owner: string;
property relatedInformation
relatedInformation?: IRelatedInformation[];
property resource
resource: Uri;
property severity
severity: MarkerSeverity;
property source
source?: string;
property startColumn
startColumn: number;
property startLineNumber
startLineNumber: number;
property tags
tags?: MarkerTag[];
interface IMarkerData
interface IMarkerData {}
A structure defining a problem/warning/etc.
property code
code?: | string | { value: string; target: Uri; };
property endColumn
endColumn: number;
property endLineNumber
endLineNumber: number;
property message
message: string;
property modelVersionId
modelVersionId?: number;
property relatedInformation
relatedInformation?: IRelatedInformation[];
property severity
severity: MarkerSeverity;
property source
source?: string;
property startColumn
startColumn: number;
property startLineNumber
startLineNumber: number;
property tags
tags?: MarkerTag[];
interface IModelChangedEvent
interface IModelChangedEvent {}
An event describing that an editor has had its model reset (i.e.
editor.setModel()
).
property newModelUrl
readonly newModelUrl: Uri | null;
The
uri
of the new model or null.
property oldModelUrl
readonly oldModelUrl: Uri | null;
The
uri
of the previous model or null.
interface IModelContentChange
interface IModelContentChange {}
property range
readonly range: IRange;
The range that got replaced.
property rangeLength
readonly rangeLength: number;
The length of the range that got replaced.
property rangeOffset
readonly rangeOffset: number;
The offset of the range that got replaced.
property text
readonly text: string;
The new text for the range.
interface IModelContentChangedEvent
interface IModelContentChangedEvent {}
An event describing a change in the text of a model.
property changes
readonly changes: IModelContentChange[];
The changes are ordered from the end of the document to the beginning, so they should be safe to apply in sequence.
property eol
readonly eol: string;
The (new) end-of-line character.
property isEolChange
readonly isEolChange: boolean;
Flag that indicates that this event describes an eol change.
property isFlush
readonly isFlush: boolean;
Flag that indicates that all decorations were lost with this edit. The model has been reset to a new value.
property isRedoing
readonly isRedoing: boolean;
Flag that indicates that this event was generated while redoing.
property isUndoing
readonly isUndoing: boolean;
Flag that indicates that this event was generated while undoing.
property versionId
readonly versionId: number;
The new version id the model has transitioned to.
interface IModelDecoration
interface IModelDecoration {}
A decoration in the model.
property id
readonly id: string;
Identifier for a decoration.
property options
readonly options: IModelDecorationOptions;
Options associated with this decoration.
property ownerId
readonly ownerId: number;
Identifier for a decoration's owner.
property range
readonly range: Range;
Range that this decoration covers.
interface IModelDecorationGlyphMarginOptions
interface IModelDecorationGlyphMarginOptions {}
property persistLane
persistLane?: boolean;
Whether the glyph margin lane in position should be rendered even outside of this decoration's range.
property position
position: GlyphMarginLane;
The position in the glyph margin.
interface IModelDecorationMinimapOptions
interface IModelDecorationMinimapOptions extends IDecorationOptions {}
Options for rendering a model decoration in the minimap.
property position
position: MinimapPosition;
The position in the minimap.
property sectionHeaderStyle
sectionHeaderStyle?: MinimapSectionHeaderStyle | null;
If the decoration is for a section header, which header style.
property sectionHeaderText
sectionHeaderText?: string | null;
If the decoration is for a section header, the header text.
interface IModelDecorationOptions
interface IModelDecorationOptions {}
Options for a model decoration.
property after
after?: InjectedTextOptions | null;
If set, text will be injected in the view after the range.
property afterContentClassName
afterContentClassName?: string | null;
If set, the decoration will be rendered after the text with this CSS class name.
property before
before?: InjectedTextOptions | null;
If set, text will be injected in the view before the range.
property beforeContentClassName
beforeContentClassName?: string | null;
If set, the decoration will be rendered before the text with this CSS class name.
property blockClassName
blockClassName?: string | null;
property blockDoesNotCollapse
blockDoesNotCollapse?: boolean | null;
property blockIsAfterEnd
blockIsAfterEnd?: boolean | null;
Indicates if this block should be rendered after the last line. In this case, the range must be empty and set to the last line.
property blockPadding
blockPadding?: [top: number, right: number, bottom: number, left: number] | null;
property className
className?: string | null;
CSS class name describing the decoration.
property firstLineDecorationClassName
firstLineDecorationClassName?: string | null;
If set, the decoration will be rendered in the lines decorations with this CSS class name, but only for the first line in case of line wrapping.
property glyphMargin
glyphMargin?: IModelDecorationGlyphMarginOptions | null;
If set and the decoration has glyphMarginClassName set, render this decoration with the specified IModelDecorationGlyphMarginOptions in the glyph margin.
property glyphMarginClassName
glyphMarginClassName?: string | null;
If set, the decoration will be rendered in the glyph margin with this CSS class name.
property glyphMarginHoverMessage
glyphMarginHoverMessage?: IMarkdownString | IMarkdownString[] | null;
Message to be rendered when hovering over the glyph margin decoration.
property hoverMessage
hoverMessage?: IMarkdownString | IMarkdownString[] | null;
Array of MarkdownString to render as the decoration message.
property inlineClassName
inlineClassName?: string | null;
If set, the decoration will be rendered inline with the text with this CSS class name. Please use this only for CSS rules that must impact the text. For example, use
className
to have a background color decoration.
property inlineClassNameAffectsLetterSpacing
inlineClassNameAffectsLetterSpacing?: boolean;
If there is an
inlineClassName
which affects letter spacing.
property isWholeLine
isWholeLine?: boolean;
Should the decoration expand to encompass a whole line.
property lineNumberClassName
lineNumberClassName?: string | null;
If set, the decoration will be rendered on the line number.
property lineNumberHoverMessage
lineNumberHoverMessage?: IMarkdownString | IMarkdownString[] | null;
Array of MarkdownString to render as the line number message.
property linesDecorationsClassName
linesDecorationsClassName?: string | null;
If set, the decoration will be rendered in the lines decorations with this CSS class name.
property linesDecorationsTooltip
linesDecorationsTooltip?: string | null;
Controls the tooltip text of the line decoration.
property marginClassName
marginClassName?: string | null;
If set, the decoration will be rendered in the margin (covering its full width) with this CSS class name.
property minimap
minimap?: IModelDecorationMinimapOptions | null;
If set, render this decoration in the minimap.
property overviewRuler
overviewRuler?: IModelDecorationOverviewRulerOptions | null;
If set, render this decoration in the overview ruler.
property shouldFillLineOnLineBreak
shouldFillLineOnLineBreak?: boolean | null;
Indicates whether the decoration should span across the entire line when it continues onto the next line.
property showIfCollapsed
showIfCollapsed?: boolean;
Always render the decoration (even when the range it encompasses is collapsed).
property stickiness
stickiness?: TrackedRangeStickiness;
Customize the growing behavior of the decoration when typing at the edges of the decoration. Defaults to TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges
property zIndex
zIndex?: number;
Specifies the stack order of a decoration. A decoration with greater stack order is always in front of a decoration with a lower stack order when the decorations are on the same line.
interface IModelDecorationOverviewRulerOptions
interface IModelDecorationOverviewRulerOptions extends IDecorationOptions {}
Options for rendering a model decoration in the overview ruler.
property position
position: OverviewRulerLane;
The position in the overview ruler.
interface IModelDecorationsChangedEvent
interface IModelDecorationsChangedEvent {}
An event describing that model decorations have changed.
property affectsGlyphMargin
readonly affectsGlyphMargin: boolean;
property affectsLineNumber
readonly affectsLineNumber: boolean;
property affectsMinimap
readonly affectsMinimap: boolean;
property affectsOverviewRuler
readonly affectsOverviewRuler: boolean;
interface IModelDeltaDecoration
interface IModelDeltaDecoration {}
New model decorations.
interface IModelLanguageChangedEvent
interface IModelLanguageChangedEvent {}
An event describing that the current language associated with a model has changed.
property newLanguage
readonly newLanguage: string;
New language
property oldLanguage
readonly oldLanguage: string;
Previous language
property source
readonly source: string;
Source of the call that caused the event.
interface IModelLanguageConfigurationChangedEvent
interface IModelLanguageConfigurationChangedEvent {}
An event describing that the language configuration associated with a model has changed.
interface IModelOptionsChangedEvent
interface IModelOptionsChangedEvent {}
property indentSize
readonly indentSize: boolean;
property insertSpaces
readonly insertSpaces: boolean;
property tabSize
readonly tabSize: boolean;
property trimAutoWhitespace
readonly trimAutoWhitespace: boolean;
interface IMouseTargetContentEmpty
interface IMouseTargetContentEmpty extends IBaseMouseTarget {}
interface IMouseTargetContentEmptyData
interface IMouseTargetContentEmptyData {}
property horizontalDistanceToText
readonly horizontalDistanceToText?: number;
property isAfterLines
readonly isAfterLines: boolean;
interface IMouseTargetContentText
interface IMouseTargetContentText extends IBaseMouseTarget {}
interface IMouseTargetContentTextData
interface IMouseTargetContentTextData {}
property mightBeForeignElement
readonly mightBeForeignElement: boolean;
interface IMouseTargetContentWidget
interface IMouseTargetContentWidget extends IBaseMouseTarget {}
interface IMouseTargetMargin
interface IMouseTargetMargin extends IBaseMouseTarget {}
interface IMouseTargetMarginData
interface IMouseTargetMarginData {}
property glyphMarginLane
readonly glyphMarginLane?: GlyphMarginLane;
property glyphMarginLeft
readonly glyphMarginLeft: number;
property glyphMarginWidth
readonly glyphMarginWidth: number;
property isAfterLines
readonly isAfterLines: boolean;
property lineNumbersWidth
readonly lineNumbersWidth: number;
property offsetX
readonly offsetX: number;
interface IMouseTargetOutsideEditor
interface IMouseTargetOutsideEditor extends IBaseMouseTarget {}
property outsideDistance
readonly outsideDistance: number;
property outsidePosition
readonly outsidePosition: 'above' | 'below' | 'left' | 'right';
property type
readonly type: MouseTargetType.OUTSIDE_EDITOR;
interface IMouseTargetOverlayWidget
interface IMouseTargetOverlayWidget extends IBaseMouseTarget {}
interface IMouseTargetOverviewRuler
interface IMouseTargetOverviewRuler extends IBaseMouseTarget {}
property type
readonly type: MouseTargetType.OVERVIEW_RULER;
interface IMouseTargetScrollbar
interface IMouseTargetScrollbar extends IBaseMouseTarget {}
interface IMouseTargetTextarea
interface IMouseTargetTextarea extends IBaseMouseTarget {}
interface IMouseTargetUnknown
interface IMouseTargetUnknown extends IBaseMouseTarget {}
property type
readonly type: MouseTargetType.UNKNOWN;
interface IMouseTargetViewZone
interface IMouseTargetViewZone extends IBaseMouseTarget {}
interface IMouseTargetViewZoneData
interface IMouseTargetViewZoneData {}
property afterLineNumber
readonly afterLineNumber: number;
property position
readonly position: Position;
property positionAfter
readonly positionAfter: Position | null;
property positionBefore
readonly positionBefore: Position | null;
property viewZoneId
readonly viewZoneId: string;
interface INewScrollPosition
interface INewScrollPosition {}
property scrollLeft
scrollLeft?: number;
property scrollTop
scrollTop?: number;
interface InjectedTextOptions
interface InjectedTextOptions {}
Configures text that is injected into the view without changing the underlying document.
property attachedData
readonly attachedData?: unknown;
This field allows to attach data to this injected text. The data can be read when injected texts at a given position are queried.
property content
readonly content: string;
Sets the text to inject. Must be a single line.
property cursorStops
readonly cursorStops?: InjectedTextCursorStops | null;
Configures cursor stops around injected text. Defaults to InjectedTextCursorStops.Both.
property inlineClassName
readonly inlineClassName?: string | null;
If set, the decoration will be rendered inline with the text with this CSS class name.
property inlineClassNameAffectsLetterSpacing
readonly inlineClassNameAffectsLetterSpacing?: boolean;
If there is an
inlineClassName
which affects letter spacing.
interface InternalEditorRenderLineNumbersOptions
interface InternalEditorRenderLineNumbersOptions {}
property renderFn
readonly renderFn: ((lineNumber: number) => string) | null;
property renderType
readonly renderType: RenderLineNumbersType;
interface InternalEditorScrollbarOptions
interface InternalEditorScrollbarOptions {}
property alwaysConsumeMouseWheel
readonly alwaysConsumeMouseWheel: boolean;
property arrowSize
readonly arrowSize: number;
property handleMouseWheel
readonly handleMouseWheel: boolean;
property horizontal
readonly horizontal: ScrollbarVisibility;
property horizontalHasArrows
readonly horizontalHasArrows: boolean;
property horizontalScrollbarSize
readonly horizontalScrollbarSize: number;
property horizontalSliderSize
readonly horizontalSliderSize: number;
property ignoreHorizontalScrollbarInContentHeight
readonly ignoreHorizontalScrollbarInContentHeight: boolean;
property scrollByPage
readonly scrollByPage: boolean;
property useShadows
readonly useShadows: boolean;
property vertical
readonly vertical: ScrollbarVisibility;
property verticalHasArrows
readonly verticalHasArrows: boolean;
property verticalScrollbarSize
readonly verticalScrollbarSize: number;
property verticalSliderSize
readonly verticalSliderSize: number;
interface InternalQuickSuggestionsOptions
interface InternalQuickSuggestionsOptions {}
interface IOverlayWidget
interface IOverlayWidget {}
An overlay widgets renders on top of the text.
property allowEditorOverflow
allowEditorOverflow?: boolean;
Render this overlay widget in a location where it could overflow the editor's view dom node.
property onDidLayout
onDidLayout?: IEvent<void>;
Event fired when the widget layout changes.
method getDomNode
getDomNode: () => HTMLElement;
Get the dom node of the overlay widget.
method getId
getId: () => string;
Get a unique identifier of the overlay widget.
method getMinContentWidthInPx
getMinContentWidthInPx: () => number;
The editor will ensure that the scroll width is >= than this value.
method getPosition
getPosition: () => IOverlayWidgetPosition | null;
Get the placement of the overlay widget. If null is returned, the overlay widget is responsible to place itself.
interface IOverlayWidgetPosition
interface IOverlayWidgetPosition {}
A position for rendering overlay widgets.
property preference
preference: | OverlayWidgetPositionPreference | IOverlayWidgetPositionCoordinates | null;
The position preference for the overlay widget.
property stackOridinal
stackOridinal?: number;
When set, stacks with other overlay widgets with the same preference, in an order determined by the ordinal value.
interface IOverlayWidgetPositionCoordinates
interface IOverlayWidgetPositionCoordinates {}
Represents editor-relative coordinates of an overlay widget.
interface IPartialEditorMouseEvent
interface IPartialEditorMouseEvent {}
interface IPasteAsOptions
interface IPasteAsOptions {}
Configuration options for editor pasting as into behavior
property enabled
enabled?: boolean;
Enable paste as functionality in editors. Defaults to true.
property showPasteSelector
showPasteSelector?: 'afterPaste' | 'never';
Controls if a widget is shown after a drop. Defaults to 'afterPaste'.
interface IPasteEvent
interface IPasteEvent {}
A paste event originating from the editor.
property clipboardEvent
readonly clipboardEvent?: ClipboardEvent;
property languageId
readonly languageId: string | null;
property range
readonly range: Range;
interface IQuickSuggestionsOptions
interface IQuickSuggestionsOptions {}
Configuration options for quick suggestions
interface IRelatedInformation
interface IRelatedInformation {}
property endColumn
endColumn: number;
property endLineNumber
endLineNumber: number;
property message
message: string;
property resource
resource: Uri;
property startColumn
startColumn: number;
property startLineNumber
startLineNumber: number;
interface IRulerOption
interface IRulerOption {}
interface ISingleEditOperation
interface ISingleEditOperation {}
A single edit operation, that acts as a simple replace. i.e. Replace text at
range
withtext
in model.
property forceMoveMarkers
forceMoveMarkers?: boolean;
This indicates that this operation has "insert" semantics. i.e. forceMoveMarkers = true => if
range
is collapsed, all markers at the position will be moved.
property range
range: IRange;
The range to replace. This can be empty to emulate a simple insert.
property text
text: string | null;
The text to replace with. This can be null to emulate a simple delete.
interface ISmartSelectOptions
interface ISmartSelectOptions {}
property selectLeadingAndTrailingWhitespace
selectLeadingAndTrailingWhitespace?: boolean;
property selectSubwords
selectSubwords?: boolean;
interface IStandaloneCodeEditor
interface IStandaloneCodeEditor extends ICodeEditor {}
method addAction
addAction: (descriptor: IActionDescriptor) => IDisposable;
method addCommand
addCommand: ( keybinding: number, handler: ICommandHandler, context?: string) => string | null;
method createContextKey
createContextKey: <T extends ContextKeyValue = ContextKeyValue>( key: string, defaultValue: T) => IContextKey<T>;
method updateOptions
updateOptions: (newOptions: IEditorOptions & IGlobalEditorOptions) => void;
interface IStandaloneDiffEditor
interface IStandaloneDiffEditor extends IDiffEditor {}
method addAction
addAction: (descriptor: IActionDescriptor) => IDisposable;
method addCommand
addCommand: ( keybinding: number, handler: ICommandHandler, context?: string) => string | null;
method createContextKey
createContextKey: <T extends ContextKeyValue = ContextKeyValue>( key: string, defaultValue: T) => IContextKey<T>;
method getModifiedEditor
getModifiedEditor: () => IStandaloneCodeEditor;
method getOriginalEditor
getOriginalEditor: () => IStandaloneCodeEditor;
interface IStandaloneDiffEditorConstructionOptions
interface IStandaloneDiffEditorConstructionOptions extends IDiffEditorConstructionOptions {}
The options to create a diff editor.
property autoDetectHighContrast
autoDetectHighContrast?: boolean;
If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. Defaults to true.
property theme
theme?: string;
Initial theme to be used for rendering. The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black', 'hc-light. You can create custom themes via
monaco.editor.defineTheme
. To switch a theme, usemonaco.editor.setTheme
. **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unlessautoDetectHighContrast
is set to false.
interface IStandaloneEditorConstructionOptions
interface IStandaloneEditorConstructionOptions extends IEditorConstructionOptions, IGlobalEditorOptions {}
The options to create an editor.
property accessibilityHelpUrl
accessibilityHelpUrl?: string;
An URL to open when Ctrl+H (Windows and Linux) or Cmd+H (OSX) is pressed in the accessibility help dialog in the editor.
Defaults to "https://go.microsoft.com/fwlink/?linkid=852450"
property ariaContainerElement
ariaContainerElement?: HTMLElement;
Container element to use for ARIA messages. Defaults to document.body.
property autoDetectHighContrast
autoDetectHighContrast?: boolean;
If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. Defaults to true.
property language
language?: string;
The initial language of the auto created model in the editor. To not automatically create a model, use
model: null
.
property model
model?: ITextModel | null;
The initial model associated with this code editor.
property theme
theme?: string;
Initial theme to be used for rendering. The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black', 'hc-light. You can create custom themes via
monaco.editor.defineTheme
. To switch a theme, usemonaco.editor.setTheme
. **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unlessautoDetectHighContrast
is set to false.
property value
value?: string;
The initial value of the auto created model in the editor. To not automatically create a model, use
model: null
.
interface IStandaloneThemeData
interface IStandaloneThemeData {}
property base
base: BuiltinTheme;
property colors
colors: IColors;
property encodedTokensColors
encodedTokensColors?: string[];
property inherit
inherit: boolean;
property rules
rules: ITokenThemeRule[];
interface ISuggestOptions
interface ISuggestOptions {}
Configuration options for editor suggest widget
property filterGraceful
filterGraceful?: boolean;
Enable graceful matching. Defaults to true.
property insertMode
insertMode?: 'insert' | 'replace';
Overwrite word ends on accept. Default to false.
property localityBonus
localityBonus?: boolean;
Favors words that appear close to the cursor.
property matchOnWordStartOnly
matchOnWordStartOnly?: boolean;
Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
property preview
preview?: boolean;
Enable or disable the rendering of the suggestion preview.
property previewMode
previewMode?: 'prefix' | 'subword' | 'subwordSmart';
Configures the mode of the preview.
property selectionMode
selectionMode?: | 'always' | 'never' | 'whenTriggerCharacter' | 'whenQuickSuggestion';
Select suggestions when triggered via quick suggest or trigger characters
property shareSuggestSelections
shareSuggestSelections?: boolean;
Enable using global storage for remembering suggestions.
property showClasses
showClasses?: boolean;
Show class-suggestions.
property showColors
showColors?: boolean;
Show color-suggestions.
property showConstants
showConstants?: boolean;
Show constant-suggestions.
property showConstructors
showConstructors?: boolean;
Show constructor-suggestions.
property showDeprecated
showDeprecated?: boolean;
Show deprecated-suggestions.
property showEnumMembers
showEnumMembers?: boolean;
Show enumMember-suggestions.
property showEnums
showEnums?: boolean;
Show enum-suggestions.
property showEvents
showEvents?: boolean;
Show event-suggestions.
property showFields
showFields?: boolean;
Show field-suggestions.
property showFiles
showFiles?: boolean;
Show file-suggestions.
property showFolders
showFolders?: boolean;
Show folder-suggestions.
property showFunctions
showFunctions?: boolean;
Show function-suggestions.
property showIcons
showIcons?: boolean;
Enable or disable icons in suggestions. Defaults to true.
property showInlineDetails
showInlineDetails?: boolean;
Show details inline with the label. Defaults to true.
property showInterfaces
showInterfaces?: boolean;
Show interface-suggestions.
property showIssues
showIssues?: boolean;
Show issue-suggestions.
property showKeywords
showKeywords?: boolean;
Show keyword-suggestions.
property showMethods
showMethods?: boolean;
Show method-suggestions.
property showModules
showModules?: boolean;
Show module-suggestions.
property showOperators
showOperators?: boolean;
Show operator-suggestions.
property showProperties
showProperties?: boolean;
Show property-suggestions.
property showReferences
showReferences?: boolean;
Show reference-suggestions.
property showSnippets
showSnippets?: boolean;
Show snippet-suggestions.
property showStatusBar
showStatusBar?: boolean;
Enable or disable the suggest status bar.
property showStructs
showStructs?: boolean;
Show struct-suggestions.
property showTypeParameters
showTypeParameters?: boolean;
Show typeParameter-suggestions.
property showUnits
showUnits?: boolean;
Show unit-suggestions.
property showUsers
showUsers?: boolean;
Show user-suggestions.
property showValues
showValues?: boolean;
Show value-suggestions.
property showVariables
showVariables?: boolean;
Show variable-suggestions.
property showWords
showWords?: boolean;
Show text-suggestions.
property snippetsPreventQuickSuggestions
snippetsPreventQuickSuggestions?: boolean;
Prevent quick suggestions when a snippet is active. Defaults to true.
interface ITextModel
interface ITextModel {}
A model.
property id
readonly id: string;
A unique identifier associated with this model.
property onDidChangeAttached
readonly onDidChangeAttached: IEvent<void>;
An event emitted when the model has been attached to the first editor or detached from the last editor.
property onDidChangeDecorations
readonly onDidChangeDecorations: IEvent<IModelDecorationsChangedEvent>;
An event emitted when decorations of the model have changed.
property onDidChangeLanguage
readonly onDidChangeLanguage: IEvent<IModelLanguageChangedEvent>;
An event emitted when the language associated with the model has changed.
property onDidChangeLanguageConfiguration
readonly onDidChangeLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>;
An event emitted when the language configuration associated with the model has changed.
property onDidChangeOptions
readonly onDidChangeOptions: IEvent<IModelOptionsChangedEvent>;
An event emitted when the model options have changed.
property onWillDispose
readonly onWillDispose: IEvent<void>;
An event emitted right before disposing the model.
property uri
readonly uri: Uri;
Gets the resource associated with this editor model.
method applyEdits
applyEdits: { (operations: IIdentifiedSingleEditOperation[]): void; ( operations: IIdentifiedSingleEditOperation[], computeUndoEdits: false ): void; ( operations: IIdentifiedSingleEditOperation[], computeUndoEdits: true ): IValidEditOperation[];};
Edit the model without adding the edits to the undo stack. This can have dire consequences on the undo stack! See for the preferred way.
Parameter operations
The edit operations. If desired, the inverse edit operations, that, when applied, will bring the model back to the previous state.
method createSnapshot
createSnapshot: (preserveBOM?: boolean) => ITextSnapshot;
Get the text stored in this model.
Parameter preserverBOM
Preserve a BOM character if it was detected when the model was constructed. The text snapshot (it is safe to consume it asynchronously).
method deltaDecorations
deltaDecorations: ( oldDecorations: string[], newDecorations: IModelDeltaDecoration[], ownerId?: number) => string[];
Perform a minimum amount of operations, in order to transform the decorations identified by
oldDecorations
to the decorations described bynewDecorations
and returns the new identifiers associated with the resulting decorations.Parameter oldDecorations
Array containing previous decorations identifiers.
Parameter newDecorations
Array describing what decorations should result after the call.
Parameter ownerId
Identifies the editor id in which these decorations should appear. If no
ownerId
is provided, the decorations will appear in all editors that attach this model. An array containing the new decorations identifiers.
method detectIndentation
detectIndentation: ( defaultInsertSpaces: boolean, defaultTabSize: number) => void;
Detect the indentation options for this model from its content.
method dispose
dispose: () => void;
Destroy this model.
method findMatches
findMatches: { ( searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number ): FindMatch[]; ( searchString: string, searchScope: IRange | IRange[], isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean, limitResultCount?: number ): FindMatch[];};
Search the model.
Parameter searchString
The string used to search. If it is a regular expression, set
isRegex
to true.Parameter searchOnlyEditableRange
Limit the searching to only search inside the editable range of the model.
Parameter isRegex
Used to indicate that
searchString
is a regular expression.Parameter matchCase
Force the matching to match lower/upper case exactly.
Parameter wordSeparators
Force the matching to match entire words only. Pass null otherwise.
Parameter captureMatches
The result will contain the captured groups.
Parameter limitResultCount
Limit the number of results The ranges where the matches are. It is empty if not matches have been found.
Search the model.
Parameter searchString
The string used to search. If it is a regular expression, set
isRegex
to true.Parameter searchScope
Limit the searching to only search inside these ranges.
Parameter isRegex
Used to indicate that
searchString
is a regular expression.Parameter matchCase
Force the matching to match lower/upper case exactly.
Parameter wordSeparators
Force the matching to match entire words only. Pass null otherwise.
Parameter captureMatches
The result will contain the captured groups.
Parameter limitResultCount
Limit the number of results The ranges where the matches are. It is empty if no matches have been found.
method findNextMatch
findNextMatch: ( searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean) => FindMatch | null;
Search the model for the next match. Loops to the beginning of the model if needed.
Parameter searchString
The string used to search. If it is a regular expression, set
isRegex
to true.Parameter searchStart
Start the searching at the specified position.
Parameter isRegex
Used to indicate that
searchString
is a regular expression.Parameter matchCase
Force the matching to match lower/upper case exactly.
Parameter wordSeparators
Force the matching to match entire words only. Pass null otherwise.
Parameter captureMatches
The result will contain the captured groups. The range where the next match is. It is null if no next match has been found.
method findPreviousMatch
findPreviousMatch: ( searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean) => FindMatch | null;
Search the model for the previous match. Loops to the end of the model if needed.
Parameter searchString
The string used to search. If it is a regular expression, set
isRegex
to true.Parameter searchStart
Start the searching at the specified position.
Parameter isRegex
Used to indicate that
searchString
is a regular expression.Parameter matchCase
Force the matching to match lower/upper case exactly.
Parameter wordSeparators
Force the matching to match entire words only. Pass null otherwise.
Parameter captureMatches
The result will contain the captured groups. The range where the previous match is. It is null if no previous match has been found.
method getAllDecorations
getAllDecorations: ( ownerId?: number, filterOutValidation?: boolean) => IModelDecoration[];
Gets all the decorations as an array.
Parameter ownerId
If set, it will ignore decorations belonging to other owners.
Parameter filterOutValidation
If set, it will ignore decorations specific to validation (i.e. warnings, errors).
method getAllMarginDecorations
getAllMarginDecorations: (ownerId?: number) => IModelDecoration[];
Gets all decorations that render in the glyph margin as an array.
Parameter ownerId
If set, it will ignore decorations belonging to other owners.
method getAlternativeVersionId
getAlternativeVersionId: () => number;
Get the alternative version id of the model. This alternative version id is not always incremented, it will return the same values in the case of undo-redo.
method getCharacterCountInRange
getCharacterCountInRange: (range: IRange, eol?: EndOfLinePreference) => number;
Get the character count of text in a certain range.
Parameter range
The range describing what text length to get.
method getDecorationOptions
getDecorationOptions: (id: string) => IModelDecorationOptions | null;
Get the options associated with a decoration.
Parameter id
The decoration id. The decoration options or null if the decoration was not found.
method getDecorationRange
getDecorationRange: (id: string) => Range | null;
Get the range associated with a decoration.
Parameter id
The decoration id. The decoration range or null if the decoration was not found.
method getDecorationsInRange
getDecorationsInRange: ( range: IRange, ownerId?: number, filterOutValidation?: boolean, onlyMinimapDecorations?: boolean, onlyMarginDecorations?: boolean) => IModelDecoration[];
Gets all the decorations in a range as an array. Only
startLineNumber
andendLineNumber
fromrange
are used for filtering. So for now it returns all the decorations on the same line asrange
.Parameter range
The range to search in
Parameter ownerId
If set, it will ignore decorations belonging to other owners.
Parameter filterOutValidation
If set, it will ignore decorations specific to validation (i.e. warnings, errors).
Parameter onlyMinimapDecorations
If set, it will return only decorations that render in the minimap.
Parameter onlyMarginDecorations
If set, it will return only decorations that render in the glyph margin. An array with the decorations
method getEndOfLineSequence
getEndOfLineSequence: () => EndOfLineSequence;
Get the end of line sequence predominantly used in the text buffer.
method getEOL
getEOL: () => string;
Get the end of line sequence predominantly used in the text buffer. EOL char sequence (e.g.: '\n' or '\r\n').
method getFullModelRange
getFullModelRange: () => Range;
Get a range covering the entire model.
method getInjectedTextDecorations
getInjectedTextDecorations: (ownerId?: number) => IModelDecoration[];
Gets all the decorations that contain injected text.
Parameter ownerId
If set, it will ignore decorations belonging to other owners.
method getLanguageId
getLanguageId: () => string;
Get the language associated with this model.
method getLineContent
getLineContent: (lineNumber: number) => string;
Get the text for a certain line.
method getLineCount
getLineCount: () => number;
Get the number of lines in the model.
method getLineDecorations
getLineDecorations: ( lineNumber: number, ownerId?: number, filterOutValidation?: boolean) => IModelDecoration[];
Gets all the decorations for the line
lineNumber
as an array.Parameter lineNumber
The line number
Parameter ownerId
If set, it will ignore decorations belonging to other owners.
Parameter filterOutValidation
If set, it will ignore decorations specific to validation (i.e. warnings, errors). An array with the decorations
method getLineFirstNonWhitespaceColumn
getLineFirstNonWhitespaceColumn: (lineNumber: number) => number;
Returns the column before the first non whitespace character for line at
lineNumber
. Returns 0 if line is empty or contains only whitespace.
method getLineLastNonWhitespaceColumn
getLineLastNonWhitespaceColumn: (lineNumber: number) => number;
Returns the column after the last non whitespace character for line at
lineNumber
. Returns 0 if line is empty or contains only whitespace.
method getLineLength
getLineLength: (lineNumber: number) => number;
Get the text length for a certain line.
method getLineMaxColumn
getLineMaxColumn: (lineNumber: number) => number;
Get the maximum legal column for line at
lineNumber
method getLineMinColumn
getLineMinColumn: (lineNumber: number) => number;
Get the minimum legal column for line at
lineNumber
method getLinesContent
getLinesContent: () => string[];
Get the text for all lines.
method getLinesDecorations
getLinesDecorations: ( startLineNumber: number, endLineNumber: number, ownerId?: number, filterOutValidation?: boolean) => IModelDecoration[];
Gets all the decorations for the lines between
startLineNumber
andendLineNumber
as an array.Parameter startLineNumber
The start line number
Parameter endLineNumber
The end line number
Parameter ownerId
If set, it will ignore decorations belonging to other owners.
Parameter filterOutValidation
If set, it will ignore decorations specific to validation (i.e. warnings, errors). An array with the decorations
method getOffsetAt
getOffsetAt: (position: IPosition) => number;
Converts the position to a zero-based offset.
The position will be [adjusted](#TextDocument.validatePosition).
Parameter position
A position. A valid zero-based offset.
method getOptions
getOptions: () => TextModelResolvedOptions;
Get the resolved options for this model.
method getOverviewRulerDecorations
getOverviewRulerDecorations: ( ownerId?: number, filterOutValidation?: boolean) => IModelDecoration[];
Gets all the decorations that should be rendered in the overview ruler as an array.
Parameter ownerId
If set, it will ignore decorations belonging to other owners.
Parameter filterOutValidation
If set, it will ignore decorations specific to validation (i.e. warnings, errors).
method getPositionAt
getPositionAt: (offset: number) => Position;
Converts a zero-based offset to a position.
Parameter offset
A zero-based offset. A valid [position](#Position).
method getValue
getValue: (eol?: EndOfLinePreference, preserveBOM?: boolean) => string;
Get the text stored in this model.
Parameter eol
The end of line character preference. Defaults to
EndOfLinePreference.TextDefined
.Parameter preserverBOM
Preserve a BOM character if it was detected when the model was constructed. The text.
method getValueInRange
getValueInRange: (range: IRange, eol?: EndOfLinePreference) => string;
Get the text in a certain range.
Parameter range
The range describing what text to get.
Parameter eol
The end of line character preference. This will only be used for multiline ranges. Defaults to
EndOfLinePreference.TextDefined
. The text.
method getValueLength
getValueLength: (eol?: EndOfLinePreference, preserveBOM?: boolean) => number;
Get the length of the text stored in this model.
method getValueLengthInRange
getValueLengthInRange: (range: IRange, eol?: EndOfLinePreference) => number;
Get the length of text in a certain range.
Parameter range
The range describing what text length to get. The text length.
method getVersionId
getVersionId: () => number;
Get the current version id of the model. Anytime a change happens to the model (even undo/redo), the version id is incremented.
method getWordAtPosition
getWordAtPosition: (position: IPosition) => IWordAtPosition | null;
Get the word under or besides
position
.Parameter position
The position to look for a word. The word under or besides
position
. Might be null.
method getWordUntilPosition
getWordUntilPosition: (position: IPosition) => IWordAtPosition;
Get the word under or besides
position
trimmed toposition
.columnParameter position
The position to look for a word. The word under or besides
position
. Will never be null.
method isAttachedToEditor
isAttachedToEditor: () => boolean;
Returns if this model is attached to an editor or not.
method isDisposed
isDisposed: () => boolean;
Returns if the model was disposed or not.
method modifyPosition
modifyPosition: (position: IPosition, offset: number) => Position;
Advances the given position by the given offset (negative offsets are also accepted) and returns it as a new valid position.
If the offset and position are such that their combination goes beyond the beginning or end of the model, throws an exception.
If the offset is such that the new position would be in the middle of a multi-byte line terminator, throws an exception.
method normalizeIndentation
normalizeIndentation: (str: string) => string;
Normalize a string containing whitespace according to indentation rules (converts to spaces or to tabs).
method onDidChangeContent
onDidChangeContent: ( listener: (e: IModelContentChangedEvent) => void) => IDisposable;
An event emitted when the contents of the model have changed.
method popStackElement
popStackElement: () => void;
Open the current undo-redo element. This offers a way to remove the current undo/redo stop point.
method pushEditOperations
pushEditOperations: ( beforeCursorState: Selection[] | null, editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer) => Selection[] | null;
Push edit operations, basically editing the model. This is the preferred way of editing the model. The edit operations will land on the undo stack.
Parameter beforeCursorState
The cursor state before the edit operations. This cursor state will be returned when
undo
orredo
are invoked.Parameter editOperations
The edit operations.
Parameter cursorStateComputer
A callback that can compute the resulting cursors state after the edit operations have been executed. The cursor state returned by the
cursorStateComputer
.
method pushEOL
pushEOL: (eol: EndOfLineSequence) => void;
Change the end of line sequence. This is the preferred way of changing the eol sequence. This will land on the undo stack.
method pushStackElement
pushStackElement: () => void;
Close the current undo-redo element. This offers a way to create an undo/redo stop point.
method setEOL
setEOL: (eol: EndOfLineSequence) => void;
Change the end of line sequence without recording in the undo stack. This can have dire consequences on the undo stack! See for the preferred way.
method setValue
setValue: (newValue: string | ITextSnapshot) => void;
Replace the entire text buffer value contained in this model.
method updateOptions
updateOptions: (newOpts: ITextModelUpdateOptions) => void;
Change the options of this model.
method validatePosition
validatePosition: (position: IPosition) => Position;
Create a valid position.
method validateRange
validateRange: (range: IRange) => Range;
Create a valid range.
interface ITextModelUpdateOptions
interface ITextModelUpdateOptions {}
property bracketColorizationOptions
bracketColorizationOptions?: BracketPairColorizationOptions;
property indentSize
indentSize?: number | 'tabSize';
property insertSpaces
insertSpaces?: boolean;
property tabSize
tabSize?: number;
property trimAutoWhitespace
trimAutoWhitespace?: boolean;
interface ITextSnapshot
interface ITextSnapshot {}
Text snapshot that works like an iterator. Will try to return chunks of roughly ~64KB size. Will return null when finished.
method read
read: () => string | null;
interface ITokenThemeRule
interface ITokenThemeRule {}
property background
background?: string;
property fontStyle
fontStyle?: string;
property foreground
foreground?: string;
property token
token: string;
interface IUnicodeHighlightOptions
interface IUnicodeHighlightOptions {}
Configuration options for unicode highlighting.
property allowedCharacters
allowedCharacters?: Record<string, true>;
Defines allowed characters that are not being highlighted.
property allowedLocales
allowedLocales?: Record<string | '_os' | '_vscode', true>;
Unicode characters that are common in allowed locales are not being highlighted.
property ambiguousCharacters
ambiguousCharacters?: boolean;
Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.
property includeComments
includeComments?: boolean | InUntrustedWorkspace;
Controls whether characters in comments should also be subject to unicode highlighting.
property includeStrings
includeStrings?: boolean | InUntrustedWorkspace;
Controls whether characters in strings should also be subject to unicode highlighting.
property invisibleCharacters
invisibleCharacters?: boolean;
Controls whether characters that just reserve space or have no width at all are highlighted.
property nonBasicASCII
nonBasicASCII?: boolean | InUntrustedWorkspace;
Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.
interface IValidEditOperation
interface IValidEditOperation {}
interface IViewState
interface IViewState {}
A (serializable) state of the view.
property firstPosition
firstPosition: IPosition;
property firstPositionDeltaTop
firstPositionDeltaTop: number;
property scrollLeft
scrollLeft: number;
property scrollTop
scrollTop?: number;
written by previous versions
property scrollTopWithoutViewZones
scrollTopWithoutViewZones?: number;
written by previous versions
interface IViewZone
interface IViewZone {}
A view zone is a full horizontal rectangle that 'pushes' text down. The editor reserves space for view zones when rendering.
property afterColumn
afterColumn?: number;
The column after which this zone should appear. If not set, the maxLineColumn of
afterLineNumber
will be used. This is relevant for wrapped lines.
property afterColumnAffinity
afterColumnAffinity?: PositionAffinity;
If the
afterColumn
has multiple view columns, the affinity specifies which one to use. Defaults tonone
.
property afterLineNumber
afterLineNumber: number;
The line number after which this zone should appear. Use 0 to place a view zone before the first line number.
property domNode
domNode: HTMLElement;
The dom node of the view zone
property heightInLines
heightInLines?: number;
The height in lines of the view zone. If specified,
heightInPx
will be used instead of this. If neitherheightInPx
norheightInLines
is specified, a default ofheightInLines
= 1 will be chosen.
property heightInPx
heightInPx?: number;
The height in px of the view zone. If this is set, the editor will give preference to it rather than
heightInLines
above. If neitherheightInPx
norheightInLines
is specified, a default ofheightInLines
= 1 will be chosen.
property marginDomNode
marginDomNode?: HTMLElement | null;
An optional dom node for the view zone that will be placed in the margin area.
property minWidthInPx
minWidthInPx?: number;
The minimum width in px of the view zone. If this is set, the editor will ensure that the scroll width is >= than this value.
property onComputedHeight
onComputedHeight?: (height: number) => void;
Callback which gives the height in pixels of the view zone.
property onDomNodeTop
onDomNodeTop?: (top: number) => void;
Callback which gives the relative top of the view zone as it appears (taking scrolling into account).
property ordinal
ordinal?: number;
Tiebreaker that is used when multiple view zones want to be after the same line. Defaults to
afterColumn
otherwise 10000;
property showInHiddenAreas
showInHiddenAreas?: boolean;
Render the zone even when its line is hidden.
property suppressMouseDown
suppressMouseDown?: boolean;
Suppress mouse down events. If set, the editor will attach a mouse down listener to the view zone and .preventDefault on it. Defaults to false
interface IViewZoneChangeAccessor
interface IViewZoneChangeAccessor {}
An accessor that allows for zones to be added or removed.
method addZone
addZone: (zone: IViewZone) => string;
Create a new view zone.
Parameter zone
Zone to create A unique identifier to the view zone.
method layoutZone
layoutZone: (id: string) => void;
Change a zone's position. The editor will rescan the
afterLineNumber
andafterColumn
properties of a view zone.
method removeZone
removeZone: (id: string) => void;
Remove a zone
Parameter id
A unique identifier to the view zone, as returned by the
addZone
call.
interface IWebWorkerOptions
interface IWebWorkerOptions {}
property createData
createData?: any;
The data to send over when calling create on the module.
property host
host?: any;
An object that can be used by the web worker to make calls back to the main thread.
property keepIdleModels
keepIdleModels?: boolean;
Keep idle models. Defaults to false, which means that idle models will stop syncing after a while.
property label
label?: string;
A label to be used to identify the web worker for debugging purposes.
property moduleId
moduleId: string;
The AMD moduleId to load. It should export a function
create
that should return the exported proxy.
interface IWordAtPosition
interface IWordAtPosition {}
Word inside a model.
property endColumn
readonly endColumn: number;
The column where the word ends.
property startColumn
readonly startColumn: number;
The column where the word starts.
property word
readonly word: string;
The word.
interface MonacoWebWorker
interface MonacoWebWorker<T> {}
A web worker that can provide a proxy to an arbitrary file.
method dispose
dispose: () => void;
Terminate the web worker, thus invalidating the returned proxy.
method getProxy
getProxy: () => Promise<T>;
Get a proxy to the arbitrary loaded code.
method withSyncedResources
withSyncedResources: (resources: Uri[]) => Promise<T>;
Synchronize (send) the models at
resources
to the web worker, making them available in the monaco.worker.getMirrorModels().
interface OverviewRulerPosition
interface OverviewRulerPosition {}
A description for the overview ruler position.
interface ThemeColor
interface ThemeColor {}
property id
id: string;
enum AccessibilitySupport
enum AccessibilitySupport { Unknown = 0, Disabled = 1, Enabled = 2,}
enum ContentWidgetPositionPreference
enum ContentWidgetPositionPreference { EXACT = 0, ABOVE = 1, BELOW = 2,}
A positioning preference for rendering content widgets.
enum CursorChangeReason
enum CursorChangeReason { NotSet = 0, ContentFlush = 1, RecoverFromMarkers = 2, Explicit = 3, Paste = 4, Undo = 5, Redo = 6,}
Describes the reason the cursor has changed its position.
member ContentFlush
ContentFlush = 1
A
model.setValue()
was called.
member Explicit
Explicit = 3
There was an explicit user gesture.
member NotSet
NotSet = 0
Unknown or not set.
member Paste
Paste = 4
There was a Paste.
member RecoverFromMarkers
RecoverFromMarkers = 2
The
model
has been changed outside of this cursor and the cursor recovers its position from associated markers.
member Redo
Redo = 6
There was a Redo.
member Undo
Undo = 5
There was an Undo.
enum DefaultEndOfLine
enum DefaultEndOfLine { LF = 1, CRLF = 2,}
The default end of line to use when instantiating models.
enum EditorAutoIndentStrategy
enum EditorAutoIndentStrategy { None = 0, Keep = 1, Brackets = 2, Advanced = 3, Full = 4,}
Configuration options for auto indentation in the editor
enum EditorOption
enum EditorOption { acceptSuggestionOnCommitCharacter = 0, acceptSuggestionOnEnter = 1, accessibilitySupport = 2, accessibilityPageSize = 3, ariaLabel = 4, ariaRequired = 5, autoClosingBrackets = 6, autoClosingComments = 7, screenReaderAnnounceInlineSuggestion = 8, autoClosingDelete = 9, autoClosingOvertype = 10, autoClosingQuotes = 11, autoIndent = 12, automaticLayout = 13, autoSurround = 14, bracketPairColorization = 15, guides = 16, codeLens = 17, codeLensFontFamily = 18, codeLensFontSize = 19, colorDecorators = 20, colorDecoratorsLimit = 21, columnSelection = 22, comments = 23, contextmenu = 24, copyWithSyntaxHighlighting = 25, cursorBlinking = 26, cursorSmoothCaretAnimation = 27, cursorStyle = 28, cursorSurroundingLines = 29, cursorSurroundingLinesStyle = 30, cursorWidth = 31, disableLayerHinting = 32, disableMonospaceOptimizations = 33, domReadOnly = 34, dragAndDrop = 35, dropIntoEditor = 36, emptySelectionClipboard = 37, experimentalWhitespaceRendering = 38, extraEditorClassName = 39, fastScrollSensitivity = 40, find = 41, fixedOverflowWidgets = 42, folding = 43, foldingStrategy = 44, foldingHighlight = 45, foldingImportsByDefault = 46, foldingMaximumRegions = 47, unfoldOnClickAfterEndOfLine = 48, fontFamily = 49, fontInfo = 50, fontLigatures = 51, fontSize = 52, fontWeight = 53, fontVariations = 54, formatOnPaste = 55, formatOnType = 56, glyphMargin = 57, gotoLocation = 58, hideCursorInOverviewRuler = 59, hover = 60, inDiffEditor = 61, inlineSuggest = 62, inlineEdit = 63, letterSpacing = 64, lightbulb = 65, lineDecorationsWidth = 66, lineHeight = 67, lineNumbers = 68, lineNumbersMinChars = 69, linkedEditing = 70, links = 71, matchBrackets = 72, minimap = 73, mouseStyle = 74, mouseWheelScrollSensitivity = 75, mouseWheelZoom = 76, multiCursorMergeOverlapping = 77, multiCursorModifier = 78, multiCursorPaste = 79, multiCursorLimit = 80, occurrencesHighlight = 81, overviewRulerBorder = 82, overviewRulerLanes = 83, padding = 84, pasteAs = 85, parameterHints = 86, peekWidgetDefaultFocus = 87, placeholder = 88, definitionLinkOpensInPeek = 89, quickSuggestions = 90, quickSuggestionsDelay = 91, readOnly = 92, readOnlyMessage = 93, renameOnType = 94, renderControlCharacters = 95, renderFinalNewline = 96, renderLineHighlight = 97, renderLineHighlightOnlyWhenFocus = 98, renderValidationDecorations = 99, renderWhitespace = 100, revealHorizontalRightPadding = 101, roundedSelection = 102, rulers = 103, scrollbar = 104, scrollBeyondLastColumn = 105, scrollBeyondLastLine = 106, scrollPredominantAxis = 107, selectionClipboard = 108, selectionHighlight = 109, selectOnLineNumbers = 110, showFoldingControls = 111, showUnused = 112, snippetSuggestions = 113, smartSelect = 114, smoothScrolling = 115, stickyScroll = 116, stickyTabStops = 117, stopRenderingLineAfter = 118, suggest = 119, suggestFontSize = 120, suggestLineHeight = 121, suggestOnTriggerCharacters = 122, suggestSelection = 123, tabCompletion = 124, tabIndex = 125, unicodeHighlighting = 126, unusualLineTerminators = 127, useShadowDOM = 128, useTabStops = 129, wordBreak = 130, wordSegmenterLocales = 131, wordSeparators = 132, wordWrap = 133, wordWrapBreakAfterCharacters = 134, wordWrapBreakBeforeCharacters = 135, wordWrapColumn = 136, wordWrapOverride1 = 137, wordWrapOverride2 = 138, wrappingIndent = 139, wrappingStrategy = 140, showDeprecated = 141, inlayHints = 142, editorClassName = 143, pixelRatio = 144, tabFocusMode = 145, layoutInfo = 146, wrappingInfo = 147, defaultColorDecorators = 148, colorDecoratorsActivatedOn = 149, inlineCompletionsAccessibilityVerbose = 150,}
member acceptSuggestionOnCommitCharacter
acceptSuggestionOnCommitCharacter = 0
member acceptSuggestionOnEnter
acceptSuggestionOnEnter = 1
member accessibilityPageSize
accessibilityPageSize = 3
member accessibilitySupport
accessibilitySupport = 2
member ariaLabel
ariaLabel = 4
member ariaRequired
ariaRequired = 5
member autoClosingBrackets
autoClosingBrackets = 6
member autoClosingComments
autoClosingComments = 7
member autoClosingDelete
autoClosingDelete = 9
member autoClosingOvertype
autoClosingOvertype = 10
member autoClosingQuotes
autoClosingQuotes = 11
member autoIndent
autoIndent = 12
member automaticLayout
automaticLayout = 13
member autoSurround
autoSurround = 14
member bracketPairColorization
bracketPairColorization = 15
member codeLens
codeLens = 17
member codeLensFontFamily
codeLensFontFamily = 18
member codeLensFontSize
codeLensFontSize = 19
member colorDecorators
colorDecorators = 20
member colorDecoratorsActivatedOn
colorDecoratorsActivatedOn = 149
member colorDecoratorsLimit
colorDecoratorsLimit = 21
member columnSelection
columnSelection = 22
member comments
comments = 23
member contextmenu
contextmenu = 24
member copyWithSyntaxHighlighting
copyWithSyntaxHighlighting = 25
member cursorBlinking
cursorBlinking = 26
member cursorSmoothCaretAnimation
cursorSmoothCaretAnimation = 27
member cursorStyle
cursorStyle = 28
member cursorSurroundingLines
cursorSurroundingLines = 29
member cursorSurroundingLinesStyle
cursorSurroundingLinesStyle = 30
member cursorWidth
cursorWidth = 31
member defaultColorDecorators
defaultColorDecorators = 148
member definitionLinkOpensInPeek
definitionLinkOpensInPeek = 89
member disableLayerHinting
disableLayerHinting = 32
member disableMonospaceOptimizations
disableMonospaceOptimizations = 33
member domReadOnly
domReadOnly = 34
member dragAndDrop
dragAndDrop = 35
member dropIntoEditor
dropIntoEditor = 36
member editorClassName
editorClassName = 143
member emptySelectionClipboard
emptySelectionClipboard = 37
member experimentalWhitespaceRendering
experimentalWhitespaceRendering = 38
member extraEditorClassName
extraEditorClassName = 39
member fastScrollSensitivity
fastScrollSensitivity = 40
member find
find = 41
member fixedOverflowWidgets
fixedOverflowWidgets = 42
member folding
folding = 43
member foldingHighlight
foldingHighlight = 45
member foldingImportsByDefault
foldingImportsByDefault = 46
member foldingMaximumRegions
foldingMaximumRegions = 47
member foldingStrategy
foldingStrategy = 44
member fontFamily
fontFamily = 49
member fontInfo
fontInfo = 50
member fontLigatures
fontLigatures = 51
member fontSize
fontSize = 52
member fontVariations
fontVariations = 54
member fontWeight
fontWeight = 53
member formatOnPaste
formatOnPaste = 55
member formatOnType
formatOnType = 56
member glyphMargin
glyphMargin = 57
member gotoLocation
gotoLocation = 58
member guides
guides = 16
member hideCursorInOverviewRuler
hideCursorInOverviewRuler = 59
member hover
hover = 60
member inDiffEditor
inDiffEditor = 61
member inlayHints
inlayHints = 142
member inlineCompletionsAccessibilityVerbose
inlineCompletionsAccessibilityVerbose = 150
member inlineEdit
inlineEdit = 63
member inlineSuggest
inlineSuggest = 62
member layoutInfo
layoutInfo = 146
member letterSpacing
letterSpacing = 64
member lightbulb
lightbulb = 65
member lineDecorationsWidth
lineDecorationsWidth = 66
member lineHeight
lineHeight = 67
member lineNumbers
lineNumbers = 68
member lineNumbersMinChars
lineNumbersMinChars = 69
member linkedEditing
linkedEditing = 70
member links
links = 71
member matchBrackets
matchBrackets = 72
member minimap
minimap = 73
member mouseStyle
mouseStyle = 74
member mouseWheelScrollSensitivity
mouseWheelScrollSensitivity = 75
member mouseWheelZoom
mouseWheelZoom = 76
member multiCursorLimit
multiCursorLimit = 80
member multiCursorMergeOverlapping
multiCursorMergeOverlapping = 77
member multiCursorModifier
multiCursorModifier = 78
member multiCursorPaste
multiCursorPaste = 79
member occurrencesHighlight
occurrencesHighlight = 81
member overviewRulerBorder
overviewRulerBorder = 82
member overviewRulerLanes
overviewRulerLanes = 83
member padding
padding = 84
member parameterHints
parameterHints = 86
member pasteAs
pasteAs = 85
member peekWidgetDefaultFocus
peekWidgetDefaultFocus = 87
member pixelRatio
pixelRatio = 144
member placeholder
placeholder = 88
member quickSuggestions
quickSuggestions = 90
member quickSuggestionsDelay
quickSuggestionsDelay = 91
member readOnly
readOnly = 92
member readOnlyMessage
readOnlyMessage = 93
member renameOnType
renameOnType = 94
member renderControlCharacters
renderControlCharacters = 95
member renderFinalNewline
renderFinalNewline = 96
member renderLineHighlight
renderLineHighlight = 97
member renderLineHighlightOnlyWhenFocus
renderLineHighlightOnlyWhenFocus = 98
member renderValidationDecorations
renderValidationDecorations = 99
member renderWhitespace
renderWhitespace = 100
member revealHorizontalRightPadding
revealHorizontalRightPadding = 101
member roundedSelection
roundedSelection = 102
member rulers
rulers = 103
member screenReaderAnnounceInlineSuggestion
screenReaderAnnounceInlineSuggestion = 8
member scrollbar
scrollbar = 104
member scrollBeyondLastColumn
scrollBeyondLastColumn = 105
member scrollBeyondLastLine
scrollBeyondLastLine = 106
member scrollPredominantAxis
scrollPredominantAxis = 107
member selectionClipboard
selectionClipboard = 108
member selectionHighlight
selectionHighlight = 109
member selectOnLineNumbers
selectOnLineNumbers = 110
member showDeprecated
showDeprecated = 141
member showFoldingControls
showFoldingControls = 111
member showUnused
showUnused = 112
member smartSelect
smartSelect = 114
member smoothScrolling
smoothScrolling = 115
member snippetSuggestions
snippetSuggestions = 113
member stickyScroll
stickyScroll = 116
member stickyTabStops
stickyTabStops = 117
member stopRenderingLineAfter
stopRenderingLineAfter = 118
member suggest
suggest = 119
member suggestFontSize
suggestFontSize = 120
member suggestLineHeight
suggestLineHeight = 121
member suggestOnTriggerCharacters
suggestOnTriggerCharacters = 122
member suggestSelection
suggestSelection = 123
member tabCompletion
tabCompletion = 124
member tabFocusMode
tabFocusMode = 145
member tabIndex
tabIndex = 125
member unfoldOnClickAfterEndOfLine
unfoldOnClickAfterEndOfLine = 48
member unicodeHighlighting
unicodeHighlighting = 126
member unusualLineTerminators
unusualLineTerminators = 127
member useShadowDOM
useShadowDOM = 128
member useTabStops
useTabStops = 129
member wordBreak
wordBreak = 130
member wordSegmenterLocales
wordSegmenterLocales = 131
member wordSeparators
wordSeparators = 132
member wordWrap
wordWrap = 133
member wordWrapBreakAfterCharacters
wordWrapBreakAfterCharacters = 134
member wordWrapBreakBeforeCharacters
wordWrapBreakBeforeCharacters = 135
member wordWrapColumn
wordWrapColumn = 136
member wordWrapOverride1
wordWrapOverride1 = 137
member wordWrapOverride2
wordWrapOverride2 = 138
member wrappingIndent
wrappingIndent = 139
member wrappingInfo
wrappingInfo = 147
member wrappingStrategy
wrappingStrategy = 140
enum EndOfLinePreference
enum EndOfLinePreference { TextDefined = 0, LF = 1, CRLF = 2,}
End of line character preference.
member CRLF
CRLF = 2
Use carriage return and line feed (\r\n) as the end of line character.
member LF
LF = 1
Use line feed (\n) as the end of line character.
member TextDefined
TextDefined = 0
Use the end of line character identified in the text buffer.
enum EndOfLineSequence
enum EndOfLineSequence { LF = 0, CRLF = 1,}
End of line character preference.
enum GlyphMarginLane
enum GlyphMarginLane { Left = 1, Center = 2, Right = 3,}
Vertical Lane in the glyph margin of the editor.
enum InjectedTextCursorStops
enum InjectedTextCursorStops { Both = 0, Right = 1, Left = 2, None = 3,}
enum MinimapPosition
enum MinimapPosition { Inline = 1, Gutter = 2,}
Position in the minimap to render the decoration.
enum MinimapSectionHeaderStyle
enum MinimapSectionHeaderStyle { Normal = 1, Underlined = 2,}
Section header style.
member Normal
Normal = 1
member Underlined
Underlined = 2
enum MouseTargetType
enum MouseTargetType { UNKNOWN = 0, TEXTAREA = 1, GUTTER_GLYPH_MARGIN = 2, GUTTER_LINE_NUMBERS = 3, GUTTER_LINE_DECORATIONS = 4, GUTTER_VIEW_ZONE = 5, CONTENT_TEXT = 6, CONTENT_EMPTY = 7, CONTENT_VIEW_ZONE = 8, CONTENT_WIDGET = 9, OVERVIEW_RULER = 10, SCROLLBAR = 11, OVERLAY_WIDGET = 12, OUTSIDE_EDITOR = 13,}
Type of hit element with the mouse in the editor.
member CONTENT_EMPTY
CONTENT_EMPTY = 7
Mouse is on top of empty space in the content (e.g. after line text or below last line)
member CONTENT_TEXT
CONTENT_TEXT = 6
Mouse is on top of text in the content.
member CONTENT_VIEW_ZONE
CONTENT_VIEW_ZONE = 8
Mouse is on top of a view zone in the content.
member CONTENT_WIDGET
CONTENT_WIDGET = 9
Mouse is on top of a content widget.
member GUTTER_GLYPH_MARGIN
GUTTER_GLYPH_MARGIN = 2
Mouse is on top of the glyph margin
member GUTTER_LINE_DECORATIONS
GUTTER_LINE_DECORATIONS = 4
Mouse is on top of the line decorations
member GUTTER_LINE_NUMBERS
GUTTER_LINE_NUMBERS = 3
Mouse is on top of the line numbers
member GUTTER_VIEW_ZONE
GUTTER_VIEW_ZONE = 5
Mouse is on top of the whitespace left in the gutter by a view zone.
member OUTSIDE_EDITOR
OUTSIDE_EDITOR = 13
Mouse is outside of the editor.
member OVERLAY_WIDGET
OVERLAY_WIDGET = 12
Mouse is on top of an overlay widget.
member OVERVIEW_RULER
OVERVIEW_RULER = 10
Mouse is on top of the decorations overview ruler.
member SCROLLBAR
SCROLLBAR = 11
Mouse is on top of a scrollbar.
member TEXTAREA
TEXTAREA = 1
Mouse is on top of the textarea used for input.
member UNKNOWN
UNKNOWN = 0
Mouse is on top of an unknown element.
enum OverlayWidgetPositionPreference
enum OverlayWidgetPositionPreference { TOP_RIGHT_CORNER = 0, BOTTOM_RIGHT_CORNER = 1, TOP_CENTER = 2,}
A positioning preference for rendering overlay widgets.
member BOTTOM_RIGHT_CORNER
BOTTOM_RIGHT_CORNER = 1
Position the overlay widget in the bottom right corner
member TOP_CENTER
TOP_CENTER = 2
Position the overlay widget in the top center
member TOP_RIGHT_CORNER
TOP_RIGHT_CORNER = 0
Position the overlay widget in the top right corner
enum OverviewRulerLane
enum OverviewRulerLane { Left = 1, Center = 2, Right = 4, Full = 7,}
Vertical Lane in the overview ruler of the editor.
enum PositionAffinity
enum PositionAffinity { Left = 0, Right = 1, None = 2, LeftOfInjectedText = 3, RightOfInjectedText = 4,}
member Left
Left = 0
Prefers the left most position.
member LeftOfInjectedText
LeftOfInjectedText = 3
If the given position is on injected text, prefers the position left of it.
member None
None = 2
No preference.
member Right
Right = 1
Prefers the right most position.
member RightOfInjectedText
RightOfInjectedText = 4
If the given position is on injected text, prefers the position right of it.
enum RenderLineNumbersType
enum RenderLineNumbersType { Off = 0, On = 1, Relative = 2, Interval = 3, Custom = 4,}
enum RenderMinimap
enum RenderMinimap { None = 0, Text = 1, Blocks = 2,}
enum ScrollbarVisibility
enum ScrollbarVisibility { Auto = 1, Hidden = 2, Visible = 3,}
enum ScrollType
enum ScrollType { Smooth = 0, Immediate = 1,}
enum ShowLightbulbIconMode
enum ShowLightbulbIconMode { Off = 'off', OnCode = 'onCode', On = 'on',}
enum TextEditorCursorBlinkingStyle
enum TextEditorCursorBlinkingStyle { Hidden = 0, Blink = 1, Smooth = 2, Phase = 3, Expand = 4, Solid = 5,}
The kind of animation in which the editor's cursor should be rendered.
enum TextEditorCursorStyle
enum TextEditorCursorStyle { Line = 1, Block = 2, Underline = 3, LineThin = 4, BlockOutline = 5, UnderlineThin = 6,}
The style in which the editor's cursor should be rendered.
member Block
Block = 2
As a block (sitting on top of a character).
member BlockOutline
BlockOutline = 5
As an outlined block (sitting on top of a character).
member Line
Line = 1
As a vertical line (sitting between two characters).
member LineThin
LineThin = 4
As a thin vertical line (sitting between two characters).
member Underline
Underline = 3
As a horizontal line (sitting under a character).
member UnderlineThin
UnderlineThin = 6
As a thin horizontal line (sitting under a character).
enum TrackedRangeStickiness
enum TrackedRangeStickiness { AlwaysGrowsWhenTypingAtEdges = 0, NeverGrowsWhenTypingAtEdges = 1, GrowsOnlyWhenTypingBefore = 2, GrowsOnlyWhenTypingAfter = 3,}
Describes the behavior of decorations when typing/editing near their edges. Note: Please do not edit the values, as they very carefully match
DecorationRangeBehavior
member AlwaysGrowsWhenTypingAtEdges
AlwaysGrowsWhenTypingAtEdges = 0
member GrowsOnlyWhenTypingAfter
GrowsOnlyWhenTypingAfter = 3
member GrowsOnlyWhenTypingBefore
GrowsOnlyWhenTypingBefore = 2
member NeverGrowsWhenTypingAtEdges
NeverGrowsWhenTypingAtEdges = 1
enum WrappingIndent
enum WrappingIndent { None = 0, Same = 1, Indent = 2, DeepIndent = 3,}
Describes how to indent wrapped lines.
member DeepIndent
DeepIndent = 3
DeepIndent => wrapped lines get +2 indentation toward the parent.
member Indent
Indent = 2
Indent => wrapped lines get +1 indentation toward the parent.
member None
None = 0
No indentation => wrapped lines begin at column 1.
member Same
Same = 1
Same => wrapped lines get the same indentation as the parent.
type BuiltinTheme
type BuiltinTheme = 'vs' | 'vs-dark' | 'hc-black' | 'hc-light';
type ComputedEditorOptionValue
type ComputedEditorOptionValue<T extends IEditorOption<any, any>> = T extends IEditorOption<any, infer R> ? R : never;
type ContextKeyValue
type ContextKeyValue = | null | undefined | boolean | number | string | Array<null | undefined | boolean | number | string> | Record<string, null | undefined | boolean | number | string>;
type EditorAutoClosingEditStrategy
type EditorAutoClosingEditStrategy = 'always' | 'auto' | 'never';
Configuration options for typing over closing quotes or brackets
type EditorAutoClosingStrategy
type EditorAutoClosingStrategy = | 'always' | 'languageDefined' | 'beforeWhitespace' | 'never';
Configuration options for auto closing quotes and brackets
type EditorAutoSurroundStrategy
type EditorAutoSurroundStrategy = | 'languageDefined' | 'quotes' | 'brackets' | 'never';
Configuration options for auto wrapping quotes and brackets
type EditorOptionsType
type EditorOptionsType = typeof EditorOptions;
type FindComputedEditorOptionValueById
type FindComputedEditorOptionValueById<T extends EditorOption> = NonNullable< ComputedEditorOptionValue<EditorOptionsType[FindEditorOptionsKeyById<T>]>>;
type FindEditorOptionsKeyById
type FindEditorOptionsKeyById<T extends EditorOption> = { [K in keyof EditorOptionsType]: EditorOptionsType[K]['id'] extends T ? K : never;}[keyof EditorOptionsType];
type GoToLocationValues
type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto';
type IColors
type IColors = { [colorId: string]: string;};
type IEditorModel
type IEditorModel = ITextModel | IDiffEditorModel | IDiffEditorViewModel;
type IEditorViewState
type IEditorViewState = ICodeEditorViewState | IDiffEditorViewState;
An editor view state.
type IModel
type IModel = ITextModel;
type IMouseTarget
type IMouseTarget = | IMouseTargetUnknown | IMouseTargetTextarea | IMouseTargetMargin | IMouseTargetViewZone | IMouseTargetContentText | IMouseTargetContentEmpty | IMouseTargetContentWidget | IMouseTargetOverlayWidget | IMouseTargetScrollbar | IMouseTargetOverviewRuler | IMouseTargetOutsideEditor;
Target hit with the mouse in the editor.
type InUntrustedWorkspace
type InUntrustedWorkspace = 'inUntrustedWorkspace';
type IReadOnlyModel
type IReadOnlyModel = ITextModel;
type LineNumbersType
type LineNumbersType = | 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
type QuickSuggestionsValue
type QuickSuggestionsValue = 'on' | 'inline' | 'off';
namespace global
namespace global {}
variable MonacoEnvironment
let MonacoEnvironment: Environment;
namespace languages
namespace languages {}
function getEncodedLanguageId
getEncodedLanguageId: (languageId: string) => number;
function getLanguages
getLanguages: () => ILanguageExtensionPoint[];
Get the information of all the registered languages.
function onLanguage
onLanguage: (languageId: string, callback: () => void) => IDisposable;
An event emitted when a language is associated for the first time with a text model.
function onLanguageEncountered
onLanguageEncountered: (languageId: string, callback: () => void) => IDisposable;
An event emitted when a language is associated for the first time with a text model or when a language is encountered during the tokenization of another language.
function register
register: (language: ILanguageExtensionPoint) => void;
Register information about a new language.
function registerCodeActionProvider
registerCodeActionProvider: ( languageSelector: LanguageSelector, provider: CodeActionProvider, metadata?: CodeActionProviderMetadata) => IDisposable;
Register a code action provider (used by e.g. quick fix).
function registerCodeLensProvider
registerCodeLensProvider: ( languageSelector: LanguageSelector, provider: CodeLensProvider) => IDisposable;
Register a code lens provider (used by e.g. inline code lenses).
function registerColorProvider
registerColorProvider: ( languageSelector: LanguageSelector, provider: DocumentColorProvider) => IDisposable;
Register a document color provider (used by Color Picker, Color Decorator).
function registerCompletionItemProvider
registerCompletionItemProvider: ( languageSelector: LanguageSelector, provider: CompletionItemProvider) => IDisposable;
Register a completion item provider (use by e.g. suggestions).
function registerDeclarationProvider
registerDeclarationProvider: ( languageSelector: LanguageSelector, provider: DeclarationProvider) => IDisposable;
Register a declaration provider
function registerDefinitionProvider
registerDefinitionProvider: ( languageSelector: LanguageSelector, provider: DefinitionProvider) => IDisposable;
Register a definition provider (used by e.g. go to definition).
function registerDocumentFormattingEditProvider
registerDocumentFormattingEditProvider: ( languageSelector: LanguageSelector, provider: DocumentFormattingEditProvider) => IDisposable;
Register a formatter that can handle only entire models.
function registerDocumentHighlightProvider
registerDocumentHighlightProvider: ( languageSelector: LanguageSelector, provider: DocumentHighlightProvider) => IDisposable;
Register a document highlight provider (used by e.g. highlight occurrences).
function registerDocumentRangeFormattingEditProvider
registerDocumentRangeFormattingEditProvider: ( languageSelector: LanguageSelector, provider: DocumentRangeFormattingEditProvider) => IDisposable;
Register a formatter that can handle a range inside a model.
function registerDocumentRangeSemanticTokensProvider
registerDocumentRangeSemanticTokensProvider: ( languageSelector: LanguageSelector, provider: DocumentRangeSemanticTokensProvider) => IDisposable;
Register a document range semantic tokens provider. A semantic tokens provider will complement and enhance a simple top-down tokenizer. Simple top-down tokenizers can be set either via
setMonarchTokensProvider
orsetTokensProvider
.For the best user experience, register both a semantic tokens provider and a top-down tokenizer.
function registerDocumentSemanticTokensProvider
registerDocumentSemanticTokensProvider: ( languageSelector: LanguageSelector, provider: DocumentSemanticTokensProvider) => IDisposable;
Register a document semantic tokens provider. A semantic tokens provider will complement and enhance a simple top-down tokenizer. Simple top-down tokenizers can be set either via
setMonarchTokensProvider
orsetTokensProvider
.For the best user experience, register both a semantic tokens provider and a top-down tokenizer.
function registerDocumentSymbolProvider
registerDocumentSymbolProvider: ( languageSelector: LanguageSelector, provider: DocumentSymbolProvider) => IDisposable;
Register a document symbol provider (used by e.g. outline).
function registerFoldingRangeProvider
registerFoldingRangeProvider: ( languageSelector: LanguageSelector, provider: FoldingRangeProvider) => IDisposable;
Register a folding range provider
function registerHoverProvider
registerHoverProvider: ( languageSelector: LanguageSelector, provider: HoverProvider) => IDisposable;
Register a hover provider (used by e.g. editor hover).
function registerImplementationProvider
registerImplementationProvider: ( languageSelector: LanguageSelector, provider: ImplementationProvider) => IDisposable;
Register a implementation provider (used by e.g. go to implementation).
function registerInlayHintsProvider
registerInlayHintsProvider: ( languageSelector: LanguageSelector, provider: InlayHintsProvider) => IDisposable;
Register an inlay hints provider.
function registerInlineCompletionsProvider
registerInlineCompletionsProvider: ( languageSelector: LanguageSelector, provider: InlineCompletionsProvider) => IDisposable;
Register an inline completions provider.
function registerInlineEditProvider
registerInlineEditProvider: ( languageSelector: LanguageSelector, provider: InlineEditProvider) => IDisposable;
function registerLinkedEditingRangeProvider
registerLinkedEditingRangeProvider: ( languageSelector: LanguageSelector, provider: LinkedEditingRangeProvider) => IDisposable;
Register an linked editing range provider.
function registerLinkProvider
registerLinkProvider: ( languageSelector: LanguageSelector, provider: LinkProvider) => IDisposable;
Register a link provider that can find links in text.
function registerNewSymbolNameProvider
registerNewSymbolNameProvider: ( languageSelector: LanguageSelector, provider: NewSymbolNamesProvider) => IDisposable;
Register a new symbol-name provider (e.g., when a symbol is being renamed, show new possible symbol-names)
function registerOnTypeFormattingEditProvider
registerOnTypeFormattingEditProvider: ( languageSelector: LanguageSelector, provider: OnTypeFormattingEditProvider) => IDisposable;
Register a formatter than can do formatting as the user types.
function registerReferenceProvider
registerReferenceProvider: ( languageSelector: LanguageSelector, provider: ReferenceProvider) => IDisposable;
Register a reference provider (used by e.g. reference search).
function registerRenameProvider
registerRenameProvider: ( languageSelector: LanguageSelector, provider: RenameProvider) => IDisposable;
Register a rename provider (used by e.g. rename symbol).
function registerSelectionRangeProvider
registerSelectionRangeProvider: ( languageSelector: LanguageSelector, provider: SelectionRangeProvider) => IDisposable;
Register a selection range provider
function registerSignatureHelpProvider
registerSignatureHelpProvider: ( languageSelector: LanguageSelector, provider: SignatureHelpProvider) => IDisposable;
Register a signature help provider (used by e.g. parameter hints).
function registerTokensProviderFactory
registerTokensProviderFactory: ( languageId: string, factory: TokensProviderFactory) => IDisposable;
Register a tokens provider factory for a language. This tokenizer will be exclusive with a tokenizer set using
setTokensProvider
or one created usingsetMonarchTokensProvider
, but will work together with a tokens provider set usingregisterDocumentSemanticTokensProvider
orregisterDocumentRangeSemanticTokensProvider
.
function registerTypeDefinitionProvider
registerTypeDefinitionProvider: ( languageSelector: LanguageSelector, provider: TypeDefinitionProvider) => IDisposable;
Register a type definition provider (used by e.g. go to type definition).
function setColorMap
setColorMap: (colorMap: string[] | null) => void;
Change the color map that is used for token colors. Supported formats (hex): #RRGGBB, $RRGGBBAA, #RGB, #RGBA
function setLanguageConfiguration
setLanguageConfiguration: ( languageId: string, configuration: LanguageConfiguration) => IDisposable;
Set the editing configuration for a language.
function setMonarchTokensProvider
setMonarchTokensProvider: ( languageId: string, languageDef: IMonarchLanguage | Thenable<IMonarchLanguage>) => IDisposable;
Set the tokens provider for a language (monarch implementation). This tokenizer will be exclusive with a tokenizer set using
setTokensProvider
, or withregisterTokensProviderFactory
, but will work together with a tokens provider set usingregisterDocumentSemanticTokensProvider
orregisterDocumentRangeSemanticTokensProvider
.
function setTokensProvider
setTokensProvider: ( languageId: string, provider: | TokensProvider | EncodedTokensProvider | Thenable<TokensProvider | EncodedTokensProvider>) => IDisposable;
Set the tokens provider for a language (manual implementation). This tokenizer will be exclusive with a tokenizer created using
setMonarchTokensProvider
, or withregisterTokensProviderFactory
, but will work together with a tokens provider set usingregisterDocumentSemanticTokensProvider
orregisterDocumentRangeSemanticTokensProvider
.
class FoldingRangeKind
class FoldingRangeKind {}
constructor
constructor(value: string);
Creates a new FoldingRangeKind.
Parameter value
of the kind.
property Comment
static readonly Comment: FoldingRangeKind;
Kind for folding range representing a comment. The value of the kind is 'comment'.
property Imports
static readonly Imports: FoldingRangeKind;
Kind for folding range representing a import. The value of the kind is 'imports'.
property Region
static readonly Region: FoldingRangeKind;
Kind for folding range representing regions (for example marked by
#region
,#endregion
). The value of the kind is 'region'.
property value
value: string;
method fromValue
static fromValue: (value: string) => FoldingRangeKind;
Returns a FoldingRangeKind for the given value.
Parameter value
of the kind.
class SelectedSuggestionInfo
class SelectedSuggestionInfo {}
constructor
constructor( range: IRange, text: string, completionKind: CompletionItemKind, isSnippetText: boolean);
property completionKind
readonly completionKind: CompletionItemKind;
property isSnippetText
readonly isSnippetText: boolean;
property range
readonly range: IRange;
property text
readonly text: string;
method equals
equals: (other: SelectedSuggestionInfo) => boolean;
interface CodeAction
interface CodeAction {}
property command
command?: Command;
property diagnostics
diagnostics?: editor.IMarkerData[];
property disabled
disabled?: string;
property edit
edit?: WorkspaceEdit;
property isAI
isAI?: boolean;
property isPreferred
isPreferred?: boolean;
property kind
kind?: string;
property ranges
ranges?: IRange[];
property title
title: string;
interface CodeActionContext
interface CodeActionContext {}
Contains additional diagnostic information about the context in which a [code action](#CodeActionProvider.provideCodeActions) is run.
interface CodeActionList
interface CodeActionList extends IDisposable {}
property actions
readonly actions: ReadonlyArray<CodeAction>;
interface CodeActionProvider
interface CodeActionProvider {}
The code action interface defines the contract between extensions and the [light bulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) feature.
method provideCodeActions
provideCodeActions: ( model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken) => ProviderResult<CodeActionList>;
Provide commands for the given document and range.
method resolveCodeAction
resolveCodeAction: ( codeAction: CodeAction, token: CancellationToken) => ProviderResult<CodeAction>;
Given a code action fill in the edit. Will only invoked when missing.
interface CodeActionProviderMetadata
interface CodeActionProviderMetadata {}
Metadata about the type of code actions that a CodeActionProvider provides.
property documentation
readonly documentation?: ReadonlyArray<{ readonly kind: string; readonly command: Command;}>;
property providedCodeActionKinds
readonly providedCodeActionKinds?: readonly string[];
List of code action kinds that a CodeActionProvider may return.
This list is used to determine if a given
CodeActionProvider
should be invoked or not. To avoid unnecessary computation, everyCodeActionProvider
should list useprovidedCodeActionKinds
. The list of kinds may either be generic, such as["quickfix", "refactor", "source"]
, or list out every kind provided, such as["quickfix.removeLine", "source.fixAll" ...]
.
interface CodeLens
interface CodeLens {}
interface CodeLensList
interface CodeLensList {}
interface CodeLensProvider
interface CodeLensProvider {}
property onDidChange
onDidChange?: IEvent<this>;
method provideCodeLenses
provideCodeLenses: ( model: editor.ITextModel, token: CancellationToken) => ProviderResult<CodeLensList>;
method resolveCodeLens
resolveCodeLens: ( model: editor.ITextModel, codeLens: CodeLens, token: CancellationToken) => ProviderResult<CodeLens>;
interface Command
interface Command {}
interface CommentAuthorInformation
interface CommentAuthorInformation {}
interface CommentRule
interface CommentRule {}
Describes how comments for a language work.
property blockComment
blockComment?: CharacterPair | null;
The block comment character pair, like
/* block comment */
property lineComment
lineComment?: string | null;
The line comment token, like
// this is a comment
interface CommentThreadRevealOptions
interface CommentThreadRevealOptions {}
property focusReply
focusReply: boolean;
property preserveFocus
preserveFocus: boolean;
interface CompletionContext
interface CompletionContext {}
Contains additional information about the context in which is triggered.
property triggerCharacter
triggerCharacter?: string;
Character that triggered the completion item provider.
undefined
if provider was not triggered by a character.
property triggerKind
triggerKind: CompletionTriggerKind;
How the completion was triggered.
interface CompletionItem
interface CompletionItem {}
A completion item represents a text snippet that is proposed to complete text that is being typed.
property additionalTextEdits
additionalTextEdits?: editor.ISingleEditOperation[];
An optional array of additional text edits that are applied when selecting this completion. Edits must not overlap with the main edit nor with themselves.
property command
command?: Command;
A command that should be run upon acceptance of this item.
property commitCharacters
commitCharacters?: string[];
An optional set of characters that when pressed while this completion is active will accept it first and then type that character. *Note* that all commit characters should have
length=1
and that superfluous characters will be ignored.
property detail
detail?: string;
A human-readable string with additional information about this item, like type or symbol information.
property documentation
documentation?: string | IMarkdownString;
A human-readable string that represents a doc-comment.
property filterText
filterText?: string;
A string that should be used when filtering a set of completion items. When
falsy
the is used.
property insertText
insertText: string;
A string or snippet that should be inserted in a document when selecting this completion.
property insertTextRules
insertTextRules?: CompletionItemInsertTextRule;
Additional rules (as bitmask) that should be applied when inserting this completion.
property kind
kind: CompletionItemKind;
The kind of this completion item. Based on the kind an icon is chosen by the editor.
property label
label: string | CompletionItemLabel;
The label of this completion item. By default this is also the text that is inserted when selecting this completion.
property preselect
preselect?: boolean;
Select this item when showing. *Note* that only one completion item can be selected and that the editor decides which item that is. The rule is that the *first* item of those that match best is selected.
property range
range: IRange | CompletionItemRanges;
A range of text that should be replaced by this completion item.
Defaults to a range from the start of the to the current position.
*Note:* The range must be a and it must the position at which completion has been .
property sortText
sortText?: string;
A string that should be used when comparing this item with other items. When
falsy
the is used.
property tags
tags?: ReadonlyArray<CompletionItemTag>;
A modifier to the
kind
which affect how the item is rendered, e.g. Deprecated is rendered with a strikeout
interface CompletionItemLabel
interface CompletionItemLabel {}
property description
description?: string;
property detail
detail?: string;
property label
label: string;
interface CompletionItemProvider
interface CompletionItemProvider {}
The completion item provider interface defines the contract between extensions and the [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense).
When computing *complete* completion items is expensive, providers can optionally implement the
resolveCompletionItem
-function. In that case it is enough to return completion items with a from the -function. Subsequently, when a completion item is shown in the UI and gains focus this provider is asked to resolve the item, like adding or .
property triggerCharacters
triggerCharacters?: string[];
method provideCompletionItems
provideCompletionItems: ( model: editor.ITextModel, position: Position, context: CompletionContext, token: CancellationToken) => ProviderResult<CompletionList>;
Provide completion items for the given position and document.
method resolveCompletionItem
resolveCompletionItem: ( item: CompletionItem, token: CancellationToken) => ProviderResult<CompletionItem>;
Given a completion item fill in more data, like or .
The editor will only resolve a completion item once.
interface CompletionItemRanges
interface CompletionItemRanges {}
interface CompletionList
interface CompletionList {}
property incomplete
incomplete?: boolean;
property suggestions
suggestions: CompletionItem[];
method dispose
dispose: () => void;
interface DeclarationProvider
interface DeclarationProvider {}
The definition provider interface defines the contract between extensions and the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition) and peek definition features.
method provideDeclaration
provideDeclaration: ( model: editor.ITextModel, position: Position, token: CancellationToken) => ProviderResult<Definition | LocationLink[]>;
Provide the declaration of the symbol at the given position and document.
interface DefinitionProvider
interface DefinitionProvider {}
The definition provider interface defines the contract between extensions and the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition) and peek definition features.
method provideDefinition
provideDefinition: ( model: editor.ITextModel, position: Position, token: CancellationToken) => ProviderResult<Definition | LocationLink[]>;
Provide the definition of the symbol at the given position and document.
interface DocumentColorProvider
interface DocumentColorProvider {}
A provider of colors for editor models.
method provideColorPresentations
provideColorPresentations: ( model: editor.ITextModel, colorInfo: IColorInformation, token: CancellationToken) => ProviderResult<IColorPresentation[]>;
Provide the string representations for a color.
method provideDocumentColors
provideDocumentColors: ( model: editor.ITextModel, token: CancellationToken) => ProviderResult<IColorInformation[]>;
Provides the color ranges for a specific model.
interface DocumentContextItem
interface DocumentContextItem {}
interface DocumentFormattingEditProvider
interface DocumentFormattingEditProvider {}
The document formatting provider interface defines the contract between extensions and the formatting-feature.
property displayName
readonly displayName?: string;
method provideDocumentFormattingEdits
provideDocumentFormattingEdits: ( model: editor.ITextModel, options: FormattingOptions, token: CancellationToken) => ProviderResult<TextEdit[]>;
Provide formatting edits for a whole document.
interface DocumentHighlight
interface DocumentHighlight {}
A document highlight is a range inside a text document which deserves special attention. Usually a document highlight is visualized by changing the background color of its range.
interface DocumentHighlightProvider
interface DocumentHighlightProvider {}
The document highlight provider interface defines the contract between extensions and the word-highlight-feature.
method provideDocumentHighlights
provideDocumentHighlights: ( model: editor.ITextModel, position: Position, token: CancellationToken) => ProviderResult<DocumentHighlight[]>;
Provide a set of document highlights, like all occurrences of a variable or all exit-points of a function.
interface DocumentRangeFormattingEditProvider
interface DocumentRangeFormattingEditProvider {}
The document formatting provider interface defines the contract between extensions and the formatting-feature.
property displayName
readonly displayName?: string;
method provideDocumentRangeFormattingEdits
provideDocumentRangeFormattingEdits: ( model: editor.ITextModel, range: Range, options: FormattingOptions, token: CancellationToken) => ProviderResult<TextEdit[]>;
Provide formatting edits for a range in a document.
The given range is a hint and providers can decide to format a smaller or larger range. Often this is done by adjusting the start and end of the range to full syntax nodes.
method provideDocumentRangesFormattingEdits
provideDocumentRangesFormattingEdits: ( model: editor.ITextModel, ranges: Range[], options: FormattingOptions, token: CancellationToken) => ProviderResult<TextEdit[]>;
interface DocumentRangeSemanticTokensProvider
interface DocumentRangeSemanticTokensProvider {}
method getLegend
getLegend: () => SemanticTokensLegend;
method provideDocumentRangeSemanticTokens
provideDocumentRangeSemanticTokens: ( model: editor.ITextModel, range: Range, token: CancellationToken) => ProviderResult<SemanticTokens>;
interface DocumentSemanticTokensProvider
interface DocumentSemanticTokensProvider {}
property onDidChange
onDidChange?: IEvent<void>;
method getLegend
getLegend: () => SemanticTokensLegend;
method provideDocumentSemanticTokens
provideDocumentSemanticTokens: ( model: editor.ITextModel, lastResultId: string | null, token: CancellationToken) => ProviderResult<SemanticTokens | SemanticTokensEdits>;
method releaseDocumentSemanticTokens
releaseDocumentSemanticTokens: (resultId: string | undefined) => void;
interface DocumentSymbol
interface DocumentSymbol {}
property children
children?: DocumentSymbol[];
property containerName
containerName?: string;
property detail
detail: string;
property kind
kind: SymbolKind;
property name
name: string;
property range
range: IRange;
property selectionRange
selectionRange: IRange;
property tags
tags: ReadonlyArray<SymbolTag>;
interface DocumentSymbolProvider
interface DocumentSymbolProvider {}
The document symbol provider interface defines the contract between extensions and the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol)-feature.
property displayName
displayName?: string;
method provideDocumentSymbols
provideDocumentSymbols: ( model: editor.ITextModel, token: CancellationToken) => ProviderResult<DocumentSymbol[]>;
Provide symbol information for the given document.
interface EncodedTokensProvider
interface EncodedTokensProvider {}
A "manual" provider of tokens, returning tokens in a binary form.
method getInitialState
getInitialState: () => IState;
The initial state of a language. Will be the state passed in to tokenize the first line.
method tokenize
tokenize: (line: string, state: IState) => ILineTokens;
Tokenize a line given the state at the beginning of the line.
method tokenizeEncoded
tokenizeEncoded: (line: string, state: IState) => IEncodedLineTokens;
Tokenize a line given the state at the beginning of the line.
interface EnterAction
interface EnterAction {}
Describes what to do when pressing Enter.
property appendText
appendText?: string;
Describes text to be appended after the new line and after the indentation.
property indentAction
indentAction: IndentAction;
Describe what to do with the indentation.
property removeText
removeText?: number;
Describes the number of characters to remove from the new line's indentation.
interface FoldingContext
interface FoldingContext {}
interface FoldingMarkers
interface FoldingMarkers {}
Describes language specific folding markers such as '#region' and '#endregion'. The start and end regexes will be tested against the contents of all lines and must be designed efficiently: - the regex should start with '^' - regexp flags (i, g) are ignored
interface FoldingRange
interface FoldingRange {}
property end
end: number;
The one-based end line of the range to fold. The folded area ends with the line's last character.
property kind
kind?: FoldingRangeKind;
Describes the of the folding range such as or . The kind is used to categorize folding ranges and used by commands like 'Fold all comments'. See FoldingRangeKind for an enumeration of standardized kinds.
property start
start: number;
The one-based start line of the range to fold. The folded area starts after the line's last character.
interface FoldingRangeProvider
interface FoldingRangeProvider {}
A provider of folding ranges for editor models.
property onDidChange
onDidChange?: IEvent<this>;
An optional event to signal that the folding ranges from this provider have changed.
method provideFoldingRanges
provideFoldingRanges: ( model: editor.ITextModel, context: FoldingContext, token: CancellationToken) => ProviderResult<FoldingRange[]>;
Provides the folding ranges for a specific model.
interface FoldingRules
interface FoldingRules {}
Describes folding rules for a language.
property markers
markers?: FoldingMarkers;
Region markers used by the language.
property offSide
offSide?: boolean;
Used by the indentation based strategy to decide whether empty lines belong to the previous or the next block. A language adheres to the off-side rule if blocks in that language are expressed by their indentation. See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information. If not set,
false
is used and empty lines belong to the previous block.
interface FormattingOptions
interface FormattingOptions {}
Interface used to format a model
property insertSpaces
insertSpaces: boolean;
Prefer spaces over tabs.
property tabSize
tabSize: number;
Size of a tab in spaces.
interface Hover
interface Hover {}
A hover represents additional information for a symbol or word. Hovers are rendered in a tooltip-like widget.
property canDecreaseVerbosity
canDecreaseVerbosity?: boolean;
Can decrease the verbosity of the hover
property canIncreaseVerbosity
canIncreaseVerbosity?: boolean;
Can increase the verbosity of the hover
property contents
contents: IMarkdownString[];
The contents of this hover.
property range
range?: IRange;
The range to which this hover applies. When missing, the editor will use the range at the current position or the current position itself.
interface HoverContext
interface HoverContext<THover = Hover> {}
property verbosityRequest
verbosityRequest?: HoverVerbosityRequest<THover>;
Hover verbosity request
interface HoverProvider
interface HoverProvider<THover = Hover> {}
The hover provider interface defines the contract between extensions and the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature.
method provideHover
provideHover: ( model: editor.ITextModel, position: Position, token: CancellationToken, context?: HoverContext<THover>) => ProviderResult<THover>;
Provide a hover for the given position, context and document. Multiple hovers at the same position will be merged by the editor. A hover can have a range which defaults to the word range at the position when omitted.
interface HoverVerbosityRequest
interface HoverVerbosityRequest<THover = Hover> {}
property previousHover
previousHover: THover;
The previous hover for the same position
property verbosityDelta
verbosityDelta: number;
The delta by which to increase/decrease the hover verbosity level
interface IAutoClosingPair
interface IAutoClosingPair {}
interface IAutoClosingPairConditional
interface IAutoClosingPairConditional extends IAutoClosingPair {}
property notIn
notIn?: string[];
interface IColor
interface IColor {}
A color in RGBA format.
interface IColorInformation
interface IColorInformation {}
A color range is a range in a text model which represents a color.
interface IColorPresentation
interface IColorPresentation {}
String representations for a color
property additionalTextEdits
additionalTextEdits?: TextEdit[];
An optional array of additional that are applied when selecting this color presentation.
property label
label: string;
The label of this color presentation. It will be shown on the color picker header. By default this is also the text that is inserted when selecting this color presentation.
property textEdit
textEdit?: TextEdit;
An which is applied to a document when selecting this presentation for the color.
interface IDocComment
interface IDocComment {}
Definition of documentation comments (e.g. Javadoc/JSdoc)
interface IEncodedLineTokens
interface IEncodedLineTokens {}
The result of a line tokenization.
property endState
endState: IState;
The tokenization end state. A pointer will be held to this and the object should not be modified by the tokenizer after the pointer is returned.
property tokens
tokens: Uint32Array;
The tokens on the line in a binary, encoded format. Each token occupies two array indices. For token i: - at offset 2*i => startIndex - at offset 2*i + 1 => metadata Meta data is in binary format: - ------------------------------------------- 3322 2222 2222 1111 1111 1100 0000 0000 1098 7654 3210 9876 5432 1098 7654 3210 - ------------------------------------------- bbbb bbbb bfff ffff ffFF FFTT LLLL LLLL - ------------------------------------------- - L = EncodedLanguageId (8 bits): Use
getEncodedLanguageId
to get the encoded ID of a language. - T = StandardTokenType (2 bits): Other = 0, Comment = 1, String = 2, RegEx = 3. - F = FontStyle (4 bits): None = 0, Italic = 1, Bold = 2, Underline = 4, Strikethrough = 8. - f = foreground ColorId (9 bits) - b = background ColorId (9 bits) - The color value for each colorId is defined in IStandaloneThemeData.customTokenColors: e.g. colorId = 1 is stored in IStandaloneThemeData.customTokenColors[1]. Color id = 0 means no color, id = 1 is for the default foreground color, id = 2 for the default background.
interface IExpandedMonarchLanguageAction
interface IExpandedMonarchLanguageAction {}
property bracket
bracket?: string;
or
property cases
cases?: Object;
map from string to ILanguageAction
property goBack
goBack?: number;
go back n characters in the stream
property group
group?: IMonarchLanguageAction[];
array of actions for each parenthesized match group
property log
log?: string;
log a message to the browser console window
property next
next?: string;
the next state to push, or "@push", "@pop", "@popall"
property nextEmbedded
nextEmbedded?: string;
switch to embedded language (using the mimetype) or get out using "@pop"
property switchTo
switchTo?: string;
switch to this state
property token
token?: string;
token class (ie. css class) (or "@brackets" or "@rematch")
interface IExpandedMonarchLanguageRule
interface IExpandedMonarchLanguageRule {}
interface IInlineEdit
interface IInlineEdit {}
interface IInlineEditContext
interface IInlineEditContext {}
property triggerKind
triggerKind: InlineEditTriggerKind;
interface ILanguageExtensionPoint
interface ILanguageExtensionPoint {}
property aliases
aliases?: string[];
property configuration
configuration?: Uri;
property extensions
extensions?: string[];
property filenamePatterns
filenamePatterns?: string[];
property filenames
filenames?: string[];
property firstLine
firstLine?: string;
property id
id: string;
property mimetypes
mimetypes?: string[];
interface ILineTokens
interface ILineTokens {}
The result of a line tokenization.
interface ILink
interface ILink {}
A link inside the editor.
interface ILinksList
interface ILinksList {}
interface IMonarchLanguage
interface IMonarchLanguage {}
A Monarch language definition
property brackets
brackets?: IMonarchLanguageBracket[];
for example [['{','}','delimiter.curly']]
property defaultToken
defaultToken?: string;
if no match in the tokenizer assign this token class (default 'source')
property ignoreCase
ignoreCase?: boolean;
is the language case insensitive?
property includeLF
includeLF?: boolean;
include line feeds (in the form of a \n character) at the end of lines Defaults to false
property start
start?: string;
start symbol in the tokenizer (by default the first entry is used)
property tokenizer
tokenizer: { [name: string]: IMonarchLanguageRule[];};
map from string to ILanguageRule[]
property tokenPostfix
tokenPostfix?: string;
attach this to every token class (by default '.' + name)
property unicode
unicode?: boolean;
is the language unicode-aware? (i.e., /\u{1D306}/)
index signature
[key: string]: any;
Other keys that can be referred to by the tokenizer.
interface IMonarchLanguageBracket
interface IMonarchLanguageBracket {}
This interface can be shortened as an array, ie. ['{','}','delimiter.curly']
interface ImplementationProvider
interface ImplementationProvider {}
The implementation provider interface defines the contract between extensions and the go to implementation feature.
method provideImplementation
provideImplementation: ( model: editor.ITextModel, position: Position, token: CancellationToken) => ProviderResult<Definition | LocationLink[]>;
Provide the implementation of the symbol at the given position and document.
interface IndentationRule
interface IndentationRule {}
Describes indentation rules for a language.
property decreaseIndentPattern
decreaseIndentPattern: RegExp;
If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches).
property increaseIndentPattern
increaseIndentPattern: RegExp;
If a line matches this pattern, then all the lines after it should be indented once (until another rule matches).
property indentNextLinePattern
indentNextLinePattern?: RegExp | null;
If a line matches this pattern, then **only the next line** after it should be indented once.
property unIndentedLinePattern
unIndentedLinePattern?: RegExp | null;
If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules.
interface InlayHint
interface InlayHint {}
property kind
kind?: InlayHintKind;
property label
label: string | InlayHintLabelPart[];
property paddingLeft
paddingLeft?: boolean;
property paddingRight
paddingRight?: boolean;
property position
position: IPosition;
property textEdits
textEdits?: TextEdit[];
property tooltip
tooltip?: string | IMarkdownString;
interface InlayHintLabelPart
interface InlayHintLabelPart {}
interface InlayHintList
interface InlayHintList {}
interface InlayHintsProvider
interface InlayHintsProvider {}
property displayName
displayName?: string;
property onDidChangeInlayHints
onDidChangeInlayHints?: IEvent<void>;
method provideInlayHints
provideInlayHints: ( model: editor.ITextModel, range: Range, token: CancellationToken) => ProviderResult<InlayHintList>;
method resolveInlayHint
resolveInlayHint: ( hint: InlayHint, token: CancellationToken) => ProviderResult<InlayHint>;
interface InlineCompletion
interface InlineCompletion {}
property additionalTextEdits
readonly additionalTextEdits?: editor.ISingleEditOperation[];
An optional array of additional text edits that are applied when selecting this completion. Edits must not overlap with the main edit nor with themselves.
property command
readonly command?: Command;
property completeBracketPairs
readonly completeBracketPairs?: boolean;
If set to
true
, unopened closing brackets are removed and unclosed opening brackets are closed. Defaults tofalse
.
property filterText
readonly filterText?: string;
A text that is used to decide if this inline completion should be shown. An inline completion is shown if the text to replace is a subword of the filter text.
property insertText
readonly insertText: | string | { snippet: string; };
The text to insert. If the text contains a line break, the range must end at the end of a line. If existing text should be replaced, the existing text must be a prefix of the text to insert.
The text can also be a snippet. In that case, a preview with default parameters is shown. When accepting the suggestion, the full snippet is inserted.
property range
readonly range?: IRange;
The range to replace. Must begin and end on the same line.
interface InlineCompletionContext
interface InlineCompletionContext {}
property selectedSuggestionInfo
readonly selectedSuggestionInfo: SelectedSuggestionInfo | undefined;
property triggerKind
readonly triggerKind: InlineCompletionTriggerKind;
How the completion was triggered.
interface InlineCompletions
interface InlineCompletions<TItem extends InlineCompletion = InlineCompletion> {}
property commands
readonly commands?: Command[];
A list of commands associated with the inline completions of this list.
property enableForwardStability
readonly enableForwardStability?: boolean | undefined;
When set and the user types a suggestion without derivating from it, the inline suggestion is not updated.
property items
readonly items: readonly TItem[];
property suppressSuggestions
readonly suppressSuggestions?: boolean | undefined;
interface InlineCompletionsProvider
interface InlineCompletionsProvider< T extends InlineCompletions = InlineCompletions> {}
property groupId
groupId?: InlineCompletionProviderGroupId;
Only used for yieldsToGroupIds. Multiple providers can have the same group id.
property yieldsToGroupIds
yieldsToGroupIds?: InlineCompletionProviderGroupId[];
Returns a list of preferred provider groupIds. The current provider is only requested for completions if no provider with a preferred group id returned a result.
method freeInlineCompletions
freeInlineCompletions: (completions: T) => void;
Will be called when a completions list is no longer in use and can be garbage-collected.
method handleItemDidShow
handleItemDidShow: ( completions: T, item: T['items'][number], updatedInsertText: string) => void;
Will be called when an item is shown.
Parameter updatedInsertText
Is useful to understand bracket completion.
method handlePartialAccept
handlePartialAccept: ( completions: T, item: T['items'][number], acceptedCharacters: number, info: PartialAcceptInfo) => void;
Will be called when an item is partially accepted.
method provideInlineCompletions
provideInlineCompletions: ( model: editor.ITextModel, position: Position, context: InlineCompletionContext, token: CancellationToken) => ProviderResult<T>;
method toString
toString: () => string;
interface InlineEditProvider
interface InlineEditProvider<T extends IInlineEdit = IInlineEdit> {}
method freeInlineEdit
freeInlineEdit: (edit: T) => void;
method provideInlineEdit
provideInlineEdit: ( model: editor.ITextModel, context: IInlineEditContext, token: CancellationToken) => ProviderResult<T>;
interface IRelativePattern
interface IRelativePattern {}
property base
readonly base: string;
A base file path to which this pattern will be matched against relatively.
property pattern
readonly pattern: string;
A file glob pattern like
*.{ts,js}
that will be matched on file paths relative to the base path.Example: Given a base of
/home/work/folder
and a file path of/home/work/folder/index.js
, the file glob pattern will match onindex.js
.
interface IState
interface IState {}
The state of the tokenizer between two lines. It is useful to store flags such as in multiline comment, etc. The model will clone the previous line's state and pass it in to tokenize the next line.
interface IToken
interface IToken {}
A token.
property scopes
scopes: string;
property startIndex
startIndex: number;
interface IWorkspaceFileEdit
interface IWorkspaceFileEdit {}
property metadata
metadata?: WorkspaceEditMetadata;
property newResource
newResource?: Uri;
property oldResource
oldResource?: Uri;
property options
options?: WorkspaceFileEditOptions;
interface IWorkspaceTextEdit
interface IWorkspaceTextEdit {}
interface LanguageConfiguration
interface LanguageConfiguration {}
The language configuration interface defines the contract between extensions and various editor features, like automatic bracket insertion, automatic indentation etc.
property autoCloseBefore
autoCloseBefore?: string;
Defines what characters must be after the cursor for bracket or quote autoclosing to occur when using the 'languageDefined' autoclosing setting.
This is typically the set of characters which can not start an expression, such as whitespace, closing brackets, non-unary operators, etc.
property autoClosingPairs
autoClosingPairs?: IAutoClosingPairConditional[];
The language's auto closing pairs. The 'close' character is automatically inserted with the 'open' character is typed. If not set, the configured brackets will be used.
property brackets
brackets?: CharacterPair[];
The language's brackets. This configuration implicitly affects pressing Enter around these brackets.
property colorizedBracketPairs
colorizedBracketPairs?: CharacterPair[];
Defines a list of bracket pairs that are colorized depending on their nesting level. If not set, the configured brackets will be used.
property comments
comments?: CommentRule;
The language's comment settings.
property folding
folding?: FoldingRules;
The language's folding rules.
property indentationRules
indentationRules?: IndentationRule;
The language's indentation settings.
property onEnterRules
onEnterRules?: OnEnterRule[];
The language's rules to be evaluated when pressing Enter.
property surroundingPairs
surroundingPairs?: IAutoClosingPair[];
The language's surrounding pairs. When the 'open' character is typed on a selection, the selected string is surrounded by the open and close characters. If not set, the autoclosing pairs settings will be used.
property wordPattern
wordPattern?: RegExp;
The language's word definition. If the language supports Unicode identifiers (e.g. JavaScript), it is preferable to provide a word definition that uses exclusion of known separators. e.g.: A regex that matches anything except known separators (and dot is allowed to occur in a floating point number): /(-?\d*.\d\w*)|([^`~!@#%^&*()-=+[{]}\|;:'",.<>/?\s]+)/g
interface LanguageFilter
interface LanguageFilter {}
property exclusive
readonly exclusive?: boolean;
property hasAccessToAllModels
readonly hasAccessToAllModels?: boolean;
This provider is implemented in the UI thread.
property isBuiltin
readonly isBuiltin?: boolean;
This provider comes from a builtin extension.
property language
readonly language?: string;
property notebookType
readonly notebookType?: string;
property pattern
readonly pattern?: string | IRelativePattern;
property scheme
readonly scheme?: string;
interface LinkedEditingRangeProvider
interface LinkedEditingRangeProvider {}
The linked editing range provider interface defines the contract between extensions and the linked editing feature.
method provideLinkedEditingRanges
provideLinkedEditingRanges: ( model: editor.ITextModel, position: Position, token: CancellationToken) => ProviderResult<LinkedEditingRanges>;
Provide a list of ranges that can be edited together.
interface LinkedEditingRanges
interface LinkedEditingRanges {}
Represents a list of ranges that can be edited together along with a word pattern to describe valid contents.
property ranges
ranges: IRange[];
A list of ranges that can be edited together. The ranges must have identical length and text content. The ranges cannot overlap
property wordPattern
wordPattern?: RegExp;
An optional word pattern that describes valid contents for the given ranges. If no pattern is provided, the language configuration's word pattern will be used.
interface LinkProvider
interface LinkProvider {}
A provider of links.
property resolveLink
resolveLink?: (link: ILink, token: CancellationToken) => ProviderResult<ILink>;
method provideLinks
provideLinks: ( model: editor.ITextModel, token: CancellationToken) => ProviderResult<ILinksList>;
interface Location
interface Location {}
Represents a location inside a resource, such as a line inside a text file.
interface LocationLink
interface LocationLink {}
property originSelectionRange
originSelectionRange?: IRange;
A range to select where this link originates from.
property range
range: IRange;
The full range this link points to.
property targetSelectionRange
targetSelectionRange?: IRange;
A range to select this link points to. Must be contained in
LocationLink.range
.
property uri
uri: Uri;
The target uri this link points to.
interface MappedEditsContext
interface MappedEditsContext {}
property documents
documents: DocumentContextItem[][];
The outer array is sorted by priority - from highest to lowest. The inner arrays contain elements of the same priority.
interface MappedEditsProvider
interface MappedEditsProvider {}
method provideMappedEdits
provideMappedEdits: ( document: editor.ITextModel, codeBlocks: string[], context: MappedEditsContext, token: CancellationToken) => Promise<WorkspaceEdit | null>;
Provider maps code blocks from the chat into a workspace edit.
Parameter document
The document to provide mapped edits for.
Parameter codeBlocks
Code blocks that come from an LLM's reply. "Apply in Editor" in the panel chat only sends one edit that the user clicks on, but inline chat can send multiple blocks and let the lang server decide what to do with them.
Parameter context
The context for providing mapped edits.
Parameter token
A cancellation token.
Returns
A provider result of text edits.
interface MultiDocumentHighlight
interface MultiDocumentHighlight {}
Represents a set of document highlights for a specific Uri.
property highlights
highlights: DocumentHighlight[];
The set of highlights for the document.
property uri
uri: Uri;
The Uri of the document that the highlights belong to.
interface MultiDocumentHighlightProvider
interface MultiDocumentHighlightProvider {}
A provider that can provide document highlights across multiple documents.
property selector
readonly selector: LanguageSelector;
method provideMultiDocumentHighlights
provideMultiDocumentHighlights: ( primaryModel: editor.ITextModel, position: Position, otherModels: editor.ITextModel[], token: CancellationToken) => ProviderResult<Map<Uri, DocumentHighlight[]>>;
Provide a Map of Uri --> document highlights, like all occurrences of a variable or all exit-points of a function.
Used in cases such as split view, notebooks, etc. where there can be multiple documents with shared symbols.
Parameter primaryModel
The primary text model.
Parameter position
The position at which to provide document highlights.
Parameter otherModels
The other text models to search for document highlights.
Parameter token
A cancellation token.
Returns
A map of Uri to document highlights.
interface NewSymbolName
interface NewSymbolName {}
property newSymbolName
readonly newSymbolName: string;
property tags
readonly tags?: readonly NewSymbolNameTag[];
interface NewSymbolNamesProvider
interface NewSymbolNamesProvider {}
property supportsAutomaticNewSymbolNamesTriggerKind
supportsAutomaticNewSymbolNamesTriggerKind?: Promise<boolean | undefined>;
method provideNewSymbolNames
provideNewSymbolNames: ( model: editor.ITextModel, range: IRange, triggerKind: NewSymbolNameTriggerKind, token: CancellationToken) => ProviderResult<NewSymbolName[]>;
interface OnEnterRule
interface OnEnterRule {}
Describes a rule to be evaluated when pressing Enter.
property action
action: EnterAction;
The action to execute.
property afterText
afterText?: RegExp;
This rule will only execute if the text after the cursor matches this regular expression.
property beforeText
beforeText: RegExp;
This rule will only execute if the text before the cursor matches this regular expression.
property previousLineText
previousLineText?: RegExp;
This rule will only execute if the text above the this line matches this regular expression.
interface OnTypeFormattingEditProvider
interface OnTypeFormattingEditProvider {}
The document formatting provider interface defines the contract between extensions and the formatting-feature.
property autoFormatTriggerCharacters
autoFormatTriggerCharacters: string[];
method provideOnTypeFormattingEdits
provideOnTypeFormattingEdits: ( model: editor.ITextModel, position: Position, ch: string, options: FormattingOptions, token: CancellationToken) => ProviderResult<TextEdit[]>;
Provide formatting edits after a character has been typed.
The given position and character should hint to the provider what range the position to expand to, like find the matching
{
when}
has been entered.
interface ParameterInformation
interface ParameterInformation {}
Represents a parameter of a callable-signature. A parameter can have a label and a doc-comment.
property documentation
documentation?: string | IMarkdownString;
The human-readable doc-comment of this signature. Will be shown in the UI but can be omitted.
property label
label: string | [number, number];
The label of this signature. Will be shown in the UI.
interface PartialAcceptInfo
interface PartialAcceptInfo {}
Info provided on partial acceptance.
property kind
kind: PartialAcceptTriggerKind;
interface PendingCommentThread
interface PendingCommentThread {}
property body
body: string;
property isReply
isReply: boolean;
property range
range: IRange | undefined;
property uniqueOwner
uniqueOwner: string;
property uri
uri: Uri;
interface ReferenceContext
interface ReferenceContext {}
Value-object that contains additional information when requesting references.
property includeDeclaration
includeDeclaration: boolean;
Include the declaration of the current symbol.
interface ReferenceProvider
interface ReferenceProvider {}
The reference provider interface defines the contract between extensions and the [find references](https://code.visualstudio.com/docs/editor/editingevolved#_peek)-feature.
method provideReferences
provideReferences: ( model: editor.ITextModel, position: Position, context: ReferenceContext, token: CancellationToken) => ProviderResult<Location[]>;
Provide a set of project-wide references for the given position and document.
interface Rejection
interface Rejection {}
property rejectReason
rejectReason?: string;
interface RenameLocation
interface RenameLocation {}
interface RenameProvider
interface RenameProvider {}
method provideRenameEdits
provideRenameEdits: ( model: editor.ITextModel, position: Position, newName: string, token: CancellationToken) => ProviderResult<WorkspaceEdit & Rejection>;
method resolveRenameLocation
resolveRenameLocation: ( model: editor.ITextModel, position: Position, token: CancellationToken) => ProviderResult<RenameLocation & Rejection>;
interface SelectionRange
interface SelectionRange {}
property range
range: IRange;
interface SelectionRangeProvider
interface SelectionRangeProvider {}
method provideSelectionRanges
provideSelectionRanges: ( model: editor.ITextModel, positions: Position[], token: CancellationToken) => ProviderResult<SelectionRange[][]>;
Provide ranges that should be selected from the given position.
interface SemanticTokens
interface SemanticTokens {}
interface SemanticTokensEdit
interface SemanticTokensEdit {}
property data
readonly data?: Uint32Array;
property deleteCount
readonly deleteCount: number;
property start
readonly start: number;
interface SemanticTokensEdits
interface SemanticTokensEdits {}
interface SemanticTokensLegend
interface SemanticTokensLegend {}
property tokenModifiers
readonly tokenModifiers: string[];
property tokenTypes
readonly tokenTypes: string[];
interface SignatureHelp
interface SignatureHelp {}
Signature help represents the signature of something callable. There can be multiple signatures but only one active and only one active parameter.
property activeParameter
activeParameter: number;
The active parameter of the active signature.
property activeSignature
activeSignature: number;
The active signature.
property signatures
signatures: SignatureInformation[];
One or more signatures.
interface SignatureHelpContext
interface SignatureHelpContext {}
property activeSignatureHelp
readonly activeSignatureHelp?: SignatureHelp;
property isRetrigger
readonly isRetrigger: boolean;
property triggerCharacter
readonly triggerCharacter?: string;
property triggerKind
readonly triggerKind: SignatureHelpTriggerKind;
interface SignatureHelpProvider
interface SignatureHelpProvider {}
The signature help provider interface defines the contract between extensions and the [parameter hints](https://code.visualstudio.com/docs/editor/intellisense)-feature.
property signatureHelpRetriggerCharacters
readonly signatureHelpRetriggerCharacters?: ReadonlyArray<string>;
property signatureHelpTriggerCharacters
readonly signatureHelpTriggerCharacters?: ReadonlyArray<string>;
method provideSignatureHelp
provideSignatureHelp: ( model: editor.ITextModel, position: Position, token: CancellationToken, context: SignatureHelpContext) => ProviderResult<SignatureHelpResult>;
Provide help for the signature at the given position and document.
interface SignatureHelpResult
interface SignatureHelpResult extends IDisposable {}
property value
value: SignatureHelp;
interface SignatureInformation
interface SignatureInformation {}
Represents the signature of something callable. A signature can have a label, like a function-name, a doc-comment, and a set of parameters.
property activeParameter
activeParameter?: number;
Index of the active parameter.
If provided, this is used in place of
SignatureHelp.activeSignature
.
property documentation
documentation?: string | IMarkdownString;
The human-readable doc-comment of this signature. Will be shown in the UI but can be omitted.
property label
label: string;
The label of this signature. Will be shown in the UI.
property parameters
parameters: ParameterInformation[];
The parameters of this signature.
interface TextEdit
interface TextEdit {}
interface TokensProvider
interface TokensProvider {}
A "manual" provider of tokens.
method getInitialState
getInitialState: () => IState;
The initial state of a language. Will be the state passed in to tokenize the first line.
method tokenize
tokenize: (line: string, state: IState) => ILineTokens;
Tokenize a line given the state at the beginning of the line.
interface TokensProviderFactory
interface TokensProviderFactory {}
A factory for token providers.
method create
create: () => ProviderResult< TokensProvider | EncodedTokensProvider | IMonarchLanguage>;
interface TypeDefinitionProvider
interface TypeDefinitionProvider {}
The type definition provider interface defines the contract between extensions and the go to type definition feature.
method provideTypeDefinition
provideTypeDefinition: ( model: editor.ITextModel, position: Position, token: CancellationToken) => ProviderResult<Definition | LocationLink[]>;
Provide the type definition of the symbol at the given position and document.
interface WorkspaceEdit
interface WorkspaceEdit {}
property edits
edits: Array<IWorkspaceTextEdit | IWorkspaceFileEdit>;
interface WorkspaceEditMetadata
interface WorkspaceEditMetadata {}
property description
description?: string;
property label
label: string;
property needsConfirmation
needsConfirmation: boolean;
interface WorkspaceFileEditOptions
interface WorkspaceFileEditOptions {}
property copy
copy?: boolean;
property folder
folder?: boolean;
property ignoreIfExists
ignoreIfExists?: boolean;
property ignoreIfNotExists
ignoreIfNotExists?: boolean;
property maxSize
maxSize?: number;
property overwrite
overwrite?: boolean;
property recursive
recursive?: boolean;
property skipTrashBin
skipTrashBin?: boolean;
enum CodeActionTriggerType
enum CodeActionTriggerType { Invoke = 1, Auto = 2,}
enum CompletionItemInsertTextRule
enum CompletionItemInsertTextRule { None = 0, KeepWhitespace = 1, InsertAsSnippet = 4,}
member InsertAsSnippet
InsertAsSnippet = 4
insertText
is a snippet.
member KeepWhitespace
KeepWhitespace = 1
Adjust whitespace/indentation of multiline insert texts to match the current line indentation.
member None
None = 0
enum CompletionItemKind
enum CompletionItemKind { Method = 0, Function = 1, Constructor = 2, Field = 3, Variable = 4, Class = 5, Struct = 6, Interface = 7, Module = 8, Property = 9, Event = 10, Operator = 11, Unit = 12, Value = 13, Constant = 14, Enum = 15, EnumMember = 16, Keyword = 17, Text = 18, Color = 19, File = 20, Reference = 21, Customcolor = 22, Folder = 23, TypeParameter = 24, User = 25, Issue = 26, Snippet = 27,}
member Class
Class = 5
member Color
Color = 19
member Constant
Constant = 14
member Constructor
Constructor = 2
member Customcolor
Customcolor = 22
member Enum
Enum = 15
member EnumMember
EnumMember = 16
member Event
Event = 10
member Field
Field = 3
member File
File = 20
member Folder
Folder = 23
member Function
Function = 1
member Interface
Interface = 7
member Issue
Issue = 26
member Keyword
Keyword = 17
member Method
Method = 0
member Module
Module = 8
member Operator
Operator = 11
member Property
Property = 9
member Reference
Reference = 21
member Snippet
Snippet = 27
member Struct
Struct = 6
member Text
Text = 18
member TypeParameter
TypeParameter = 24
member Unit
Unit = 12
member User
User = 25
member Value
Value = 13
member Variable
Variable = 4
enum CompletionItemTag
enum CompletionItemTag { Deprecated = 1,}
member Deprecated
Deprecated = 1
enum CompletionTriggerKind
enum CompletionTriggerKind { Invoke = 0, TriggerCharacter = 1, TriggerForIncompleteCompletions = 2,}
How a suggest provider was triggered.
member Invoke
Invoke = 0
member TriggerCharacter
TriggerCharacter = 1
member TriggerForIncompleteCompletions
TriggerForIncompleteCompletions = 2
enum DocumentHighlightKind
enum DocumentHighlightKind { Text = 0, Read = 1, Write = 2,}
A document highlight kind.
enum HoverVerbosityAction
enum HoverVerbosityAction { Increase = 0, Decrease = 1,}
enum IndentAction
enum IndentAction { None = 0, Indent = 1, IndentOutdent = 2, Outdent = 3,}
Describes what to do with the indentation when pressing Enter.
member Indent
Indent = 1
Insert new line and indent once (relative to the previous line's indentation).
member IndentOutdent
IndentOutdent = 2
Insert two new lines: - the first one indented which will hold the cursor - the second one at the same indentation level
member None
None = 0
Insert new line and copy the previous line's indentation.
member Outdent
Outdent = 3
Insert new line and outdent once (relative to the previous line's indentation).
enum InlayHintKind
enum InlayHintKind { Type = 1, Parameter = 2,}
enum InlineCompletionTriggerKind
enum InlineCompletionTriggerKind { Automatic = 0, Explicit = 1,}
How an was triggered.
enum InlineEditTriggerKind
enum InlineEditTriggerKind { Invoke = 0, Automatic = 1,}
enum NewSymbolNameTag
enum NewSymbolNameTag { AIGenerated = 1,}
member AIGenerated
AIGenerated = 1
enum NewSymbolNameTriggerKind
enum NewSymbolNameTriggerKind { Invoke = 0, Automatic = 1,}
enum PartialAcceptTriggerKind
enum PartialAcceptTriggerKind { Word = 0, Line = 1, Suggest = 2,}
How a partial acceptance was triggered.
enum SignatureHelpTriggerKind
enum SignatureHelpTriggerKind { Invoke = 1, TriggerCharacter = 2, ContentChange = 3,}
member ContentChange
ContentChange = 3
member Invoke
Invoke = 1
member TriggerCharacter
TriggerCharacter = 2
enum SymbolKind
enum SymbolKind { File = 0, Module = 1, Namespace = 2, Package = 3, Class = 4, Method = 5, Property = 6, Field = 7, Constructor = 8, Enum = 9, Interface = 10, Function = 11, Variable = 12, Constant = 13, String = 14, Number = 15, Boolean = 16, Array = 17, Object = 18, Key = 19, Null = 20, EnumMember = 21, Struct = 22, Event = 23, Operator = 24, TypeParameter = 25,}
A symbol kind.
member Array
Array = 17
member Boolean
Boolean = 16
member Class
Class = 4
member Constant
Constant = 13
member Constructor
Constructor = 8
member Enum
Enum = 9
member EnumMember
EnumMember = 21
member Event
Event = 23
member Field
Field = 7
member File
File = 0
member Function
Function = 11
member Interface
Interface = 10
member Key
Key = 19
member Method
Method = 5
member Module
Module = 1
member Namespace
Namespace = 2
member Null
Null = 20
member Number
Number = 15
member Object
Object = 18
member Operator
Operator = 24
member Package
Package = 3
member Property
Property = 6
member String
String = 14
member Struct
Struct = 22
member TypeParameter
TypeParameter = 25
member Variable
Variable = 12
enum SymbolTag
enum SymbolTag { Deprecated = 1,}
member Deprecated
Deprecated = 1
type CharacterPair
type CharacterPair = [string, string];
A tuple of two characters, like a pair of opening and closing brackets.
type Definition
type Definition = Location | Location[] | LocationLink[];
type IMonarchLanguageAction
type IMonarchLanguageAction = | IShortMonarchLanguageAction | IExpandedMonarchLanguageAction | (IShortMonarchLanguageAction | IExpandedMonarchLanguageAction)[];
type IMonarchLanguageRule
type IMonarchLanguageRule = | IShortMonarchLanguageRule1 | IShortMonarchLanguageRule2 | IExpandedMonarchLanguageRule;
type InlineCompletionProviderGroupId
type InlineCompletionProviderGroupId = string;
type IShortMonarchLanguageAction
type IShortMonarchLanguageAction = string;
An action is either an array of actions... ... or a case statement with guards... ... or a basic action with a token value.
type IShortMonarchLanguageRule1
type IShortMonarchLanguageRule1 = [string | RegExp, IMonarchLanguageAction];
A rule is either a regular expression and an action shorthands: [reg,act] == { regex: reg, action: act} and : [reg,act,nxt] == { regex: reg, action: act{ next: nxt }}
type IShortMonarchLanguageRule2
type IShortMonarchLanguageRule2 = [string | RegExp, IMonarchLanguageAction, string];
type LanguageSelector
type LanguageSelector = | string | LanguageFilter | ReadonlyArray<string | LanguageFilter>;
type ProviderResult
type ProviderResult<T> = T | undefined | null | Thenable<T | undefined | null>;
A provider result represents the values a provider, like the HoverProvider, may return. For once this is the actual result type
T
, likeHover
, or a thenable that resolves to that typeT
. In addition,null
andundefined
can be returned - either directly or from a thenable.
namespace worker
namespace worker {}
interface IMirrorModel
interface IMirrorModel extends IMirrorTextModel {}
interface IMirrorTextModel
interface IMirrorTextModel {}
property version
readonly version: number;
interface IWorkerContext
interface IWorkerContext<H = undefined> {}
property host
host: H;
A proxy to the main thread host object.
method getMirrorModels
getMirrorModels: () => IMirrorModel[];
Get all available mirror models in this worker.
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/monaco-editor-core
.
- Markdown[](https://www.jsdocs.io/package/monaco-editor-core)
- HTML<a href="https://www.jsdocs.io/package/monaco-editor-core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 22638 ms. - Missing or incorrect documentation? Open an issue for this package.