Readonly idA unique identifier associated with this model.
Readonly uriGets the resource associated with this editor model.
Edit the model without adding the edits to the undo stack. This can have dire consequences on the undo stack! See
The edit operations.
If desired, the inverse edit operations, that, when applied, will bring the model back to the previous state.
for the preferred way.
Get the text stored in this model.
Optional preserveBOM: booleanThe text snapshot (it is safe to consume it asynchronously).
Perform a minimum amount of operations, in order to transform the decorations
identified by oldDecorations to the decorations described by newDecorations
and returns the new identifiers associated with the resulting decorations.
Array containing previous decorations identifiers.
Array describing what decorations should result after the call.
Optional ownerId: numberIdentifies 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.
Search the model.
The string used to search. If it is a regular expression, set isRegex to true.
Limit the searching to only search inside the editable range of the model.
Used to indicate that searchString is a regular expression.
Force the matching to match lower/upper case exactly.
Force the matching to match entire words only. Pass null otherwise.
The result will contain the captured groups.
Optional limitResultCount: numberLimit the number of results
The ranges where the matches are. It is empty if not matches have been found.
Search the model.
The string used to search. If it is a regular expression, set isRegex to true.
Limit the searching to only search inside these ranges.
Used to indicate that searchString is a regular expression.
Force the matching to match lower/upper case exactly.
Force the matching to match entire words only. Pass null otherwise.
The result will contain the captured groups.
Optional limitResultCount: numberLimit the number of results
The ranges where the matches are. It is empty if no matches have been found.
Search the model for the next match. Loops to the beginning of the model if needed.
The string used to search. If it is a regular expression, set isRegex to true.
Start the searching at the specified position.
Used to indicate that searchString is a regular expression.
Force the matching to match lower/upper case exactly.
Force the matching to match entire words only. Pass null otherwise.
The result will contain the captured groups.
The range where the next match is. It is null if no next match has been found.
Search the model for the previous match. Loops to the end of the model if needed.
The string used to search. If it is a regular expression, set isRegex to true.
Start the searching at the specified position.
Used to indicate that searchString is a regular expression.
Force the matching to match lower/upper case exactly.
Force the matching to match entire words only. Pass null otherwise.
The result will contain the captured groups.
The range where the previous match is. It is null if no previous match has been found.
Gets all the decorations as an array.
Optional ownerId: numberIf set, it will ignore decorations belonging to other owners.
Optional filterOutValidation: booleanIf set, it will ignore decorations specific to validation (i.e. warnings, errors).
Optional filterFontDecorations: booleanIf set, it will ignore font decorations.
Gets all decorations that render in the glyph margin as an array.
Optional ownerId: numberIf set, it will ignore decorations belonging to other owners.
Get the character count of text in a certain range.
The range describing what text length to get.
Optional eol: EndOfLinePreferenceGets all the decorations that contain custom line heights.
Optional ownerId: numberIf set, it will ignore decorations belonging to other owners.
Get the options associated with a decoration.
The decoration id.
The decoration options or null if the decoration was not found.
Gets all the decorations in a range as an array. Only startLineNumber and endLineNumber from range are used for filtering.
So for now it returns all the decorations on the same line as range.
The range to search in
Optional ownerId: numberIf set, it will ignore decorations belonging to other owners.
Optional filterOutValidation: booleanIf set, it will ignore decorations specific to validation (i.e. warnings, errors).
Optional filterFontDecorations: booleanIf set, it will ignore font decorations.
Optional onlyMinimapDecorations: booleanIf set, it will return only decorations that render in the minimap.
Optional onlyMarginDecorations: booleanIf set, it will return only decorations that render in the glyph margin.
An array with the decorations
Get the end of line sequence predominantly used in the text buffer.
Gets all the decorations that contain injected text.
Optional ownerId: numberIf set, it will ignore decorations belonging to other owners.
Gets all the decorations for the line lineNumber as an array.
The line number
Optional ownerId: numberIf set, it will ignore decorations belonging to other owners.
Optional filterOutValidation: booleanIf set, it will ignore decorations specific to validation (i.e. warnings, errors).
Optional filterFontDecorations: booleanIf set, it will ignore font decorations.
An array with the decorations
Gets all the decorations for the lines between startLineNumber and endLineNumber as an array.
The start line number
The end line number
Optional ownerId: numberIf set, it will ignore decorations belonging to other owners.
Optional filterOutValidation: booleanIf set, it will ignore decorations specific to validation (i.e. warnings, errors).
Optional filterFontDecorations: booleanIf set, it will ignore font decorations.
An array with the decorations
Get the resolved options for this model.
Gets all the decorations that should be rendered in the overview ruler as an array.
Optional ownerId: numberIf set, it will ignore decorations belonging to other owners.
Optional filterOutValidation: booleanIf set, it will ignore decorations specific to validation (i.e. warnings, errors).
Optional filterFontDecorations: booleanIf set, it will ignore font decorations.
Get the text stored in this model.
Optional eol: EndOfLinePreferenceThe end of line character preference. Defaults to EndOfLinePreference.TextDefined.
Optional preserveBOM: booleanThe text.
Get the text in a certain range.
The range describing what text to get.
Optional eol: EndOfLinePreferenceThe end of line character preference. This will only be used for multiline ranges. Defaults to EndOfLinePreference.TextDefined.
The text.
Get the length of the text stored in this model.
Optional eol: EndOfLinePreferenceOptional preserveBOM: booleanGet the length of text in a certain range.
The range describing what text length to get.
Optional eol: EndOfLinePreferenceThe text length.
Get the word under or besides position.
The position to look for a word.
The word under or besides position. Might be null.
Get the word under or besides position trimmed to position.column
The position to look for a word.
The word under or besides position. Will never be null.
Verifies the range is valid.
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.
Change the end of line sequence. This is the preferred way of changing the eol sequence. This will land on the undo stack.
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.
The cursor state before the edit operations. This cursor state will be returned when undo or redo are invoked.
The edit operations.
A callback that can compute the resulting cursors state after the edit operations have been executed.
The cursor state returned by the cursorStateComputer.
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.
Replace the entire text buffer value contained in this model.
Change the options of this model.
Readonly onAn event emitted when the model has been attached to the first editor or detached from the last editor.
Readonly onAn event emitted when decorations of the model have changed.
Readonly onAn event emitted when the language associated with the model has changed.
Readonly onAn event emitted when the language configuration associated with the model has changed.
Readonly onAn event emitted when the model options have changed.
Readonly onAn event emitted right before disposing the model.
An event emitted when the contents of the model have changed.
A model.