An event emitted when the contents of the model have changed.
An event emitted when decorations of the model have changed.
An event emitted when the language associated with the model has changed.
An event emitted when the language configuration associated with the model has changed.
An event emitted when the model options have changed.
An event emitted right before disposing the model.
A unique identifier associated with this model.
Gets 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 @pushEditOperations for the preferred way.
The edit operations.
If desired, the inverse edit operations, that, when applied, will bring the model back to the previous state.
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.
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.
Detect the indentation options for this model from its content.
Destroy this model. This will unbind the model from the mode and make all necessary clean-up to release this object to the GC.
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.
Limit 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.
Limit 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.
If set, it will ignore decorations belonging to other owners.
If set, it will ignore decorations specific to validation (i.e. warnings, errors).
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.
Get the character count of text in a certain range.
The range describing what text length to get.
Get the options associated with a decoration.
The decoration id.
The decoration options or null if the decoration was not found.
Get the range associated with a decoration.
The decoration id.
The decoration range 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
If set, it will ignore decorations belonging to other owners.
If set, it will ignore decorations specific to validation (i.e. warnings, errors).
An array with the decorations
Get the end of line sequence predominantly used in the text buffer.
EOL char sequence (e.g.: '\n' or '\r\n').
Get the end of line sequence predominantly used in the text buffer.
Get a range covering the entire model
Get the text for a certain line.
Get the number of lines in the model.
Gets all the decorations for the line lineNumber
as an array.
The line number
If set, it will ignore decorations belonging to other owners.
If set, it will ignore decorations specific to validation (i.e. warnings, errors).
An array with the decorations
Returns the column before the first non whitespace character for line at lineNumber
.
Returns 0 if line is empty or contains only whitespace.
Returns the column after the last non whitespace character for line at lineNumber
.
Returns 0 if line is empty or contains only whitespace.
Get the text length for a certain line.
Get the maximum legal column for line at lineNumber
Get the minimum legal column for line at lineNumber
Get the text for all lines.
Gets all the decorations for the lines between startLineNumber
and endLineNumber
as an array.
The start line number
The end line number
If set, it will ignore decorations belonging to other owners.
If set, it will ignore decorations specific to validation (i.e. warnings, errors).
An array with the decorations
Get the language associated with this model.
Get the resolved options for this model.
Gets all the decorations that should be rendered in the overview ruler as an array.
If set, it will ignore decorations belonging to other owners.
If set, it will ignore decorations specific to validation (i.e. warnings, errors).
Get the text stored in this model.
The end of line character preference. Defaults to EndOfLinePreference.TextDefined
.
The text.
Get the text in a certain range.
The range describing what text to get.
The 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.
Get the length of text in a certain range.
The range describing what text length to get.
The text length.
Get the current version id of the model. Anytime a change happens to the model (even undo/redo), the version id is incremented.
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.
Returns if the model was disposed or not.
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.
Normalize a string containing whitespace according to indentation rules (converts to spaces or to tabs).
Open the current undo-redo element. This offers a way to remove the current undo/redo stop point.
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
.
Close the current undo-redo element. This offers a way to create an undo/redo stop point.
Change the end of line sequence without recording in the undo stack. This can have dire consequences on the undo stack! See @pushEOL for the preferred way.
Replace the entire text buffer value contained in this model.
Change the options of this model.
Generated using TypeDoc
A model.