ReadonlyinBoolean indicating whether input is in composition
ReadonlyonSome 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 fire onEndUpdate once the operation finishes.
Note that not all operations are bracketed by onBeginUpdate and onEndUpdate.
ReadonlyonAn event emitted after composition has ended.
ReadonlyonAn event emitted after composition has started.
ReadonlyonFires after the editor completes the operation it fired onBeginUpdate for.
Add a content widget. Widgets must have unique ids, otherwise they will be overwritten.
Add a glyph margin widget. Widgets must have unique ids, otherwise they will be overwritten.
Add an overlay widget. Widgets must have unique ids, otherwise they will be overwritten.
Apply the same font settings as the editor to target.
Change the view zones. View zones are lost when a new model is attached to the editor.
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.
Optionaldecorations: IModelDeltaDecoration[]All decorations added through this call will get the ownerId of this editor.
Dispose the editor.
Execute a command on the editor. The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
The source of the call.
The command to execute
Execute multiple (concomitant) commands on the editor.
The source of the call.
Execute edits on the editor. The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
The source of the call.
The edits to execute.
OptionalendCursorState: ICursorStateComputer | Selection[]
Cursor state after the edits were applied.
Brings browser focus to the editor text
Get an action that is a contribution to this editor.
The action or null if action not found.
Get the vertical position (top offset) for the line's bottom w.r.t. to the first line.
Returns the editor's container dom node
Get the height of the editor's content.
This is information that is "erased" when computing scrollHeight = Math.max(contentHeight, height)
Get the width of the editor's content.
This is information that is "erased" when computing scrollWidth = Math.max(contentWidth, width)
Get a contribution of this editor.
The contribution or null if contribution not found.
Get all the decorations for a range (filtering out decorations from other editors).
Returns the editor's dom node
Get the editor type. Please see EditorType.
This is to avoid an instanceof check
Get the font size at a given position
the position for which to fetch the font size
Get a unique id for this editor instance.
Get the layout info for the editor.
Get all the decorations on a line (filtering out decorations from other editors).
Type the getModel() of IEditor.
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.
Gets a specific editor option.
Gets all the editor computed options.
Returns the primary position of the cursor.
Returns the editor's configuration (without any validation or defaults).
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 same position 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.
Get the scrollHeight of the editor's viewport.
Get the scrollLeft of the editor's viewport.
Get the scrollTop of the editor's viewport.
Get the scrollWidth of the editor's viewport.
Returns the primary selection of the editor.
Returns all the selections of the editor.
Returns all actions associated with this editor.
Get the hit test target at coordinates clientX and clientY.
The coordinates are relative to the top-left of the viewport.
Hit test target or null if the coordinates fall outside the editor or the editor has no model.
Get the vertical position (top offset) for the line's top w.r.t. to the first line.
OptionalincludeViewZones: booleanGet the vertical position (top offset) for the position w.r.t. to the first line.
Get value of the current model attached to this editor.
Optionaloptions: { lineEnding: string; preserveBOM: boolean }Given a position, returns a column number that takes tab-widths into account.
Returns the ranges that are currently visible. Does not account for horizontal scrolling.
OptionalhandleIs 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).
Check if the editor is currently scrolling towards a different scroll position.
Returns true if the text inside this editor is focused (i.e. cursor is blinking).
Returns true if the text inside this editor or an editor widget has focus.
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.
Optionaldimension: IDimensionOptionalpostponeRendering: booleanLayout/Reposition a content widget. This is a ping to the editor to call widget.getPosition() and update appropriately.
Layout/Reposition a glyph margin widget. This is a ping to the editor to call widget.getPosition() and update appropriately.
Layout/Reposition an overlay widget. This is a ping to the editor to call widget.getPosition() and update appropriately.
Remove the "undo stop" in the undo-redo stack.
Create an "undo stop" in the undo-redo stack.
Remove previously added decorations.
Force an editor render now.
OptionalforceRedraw: booleanRestores the view state of the editor from a serializable object generated by saveViewState.
Scroll vertically as necessary and reveal a line.
OptionalscrollType: ScrollTypeScroll vertically as necessary and reveal a line centered vertically.
OptionalscrollType: ScrollTypeScroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.
OptionalscrollType: ScrollTypeScroll vertically as necessary and reveal a line close to the top of the viewport, optimized for viewing a code definition.
OptionalscrollType: ScrollTypeScroll vertically as necessary and reveal lines.
OptionalscrollType: ScrollTypeScroll vertically as necessary and reveal lines centered vertically.
OptionalscrollType: ScrollTypeScroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.
OptionalscrollType: ScrollTypeScroll vertically as necessary and reveal lines close to the top of the viewport, optimized for viewing a code definition.
OptionalscrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a position.
OptionalscrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a position centered vertically.
OptionalscrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport.
OptionalscrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a position close to the top of the viewport, optimized for viewing a code definition.
OptionalscrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range.
OptionalscrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range at the top of the viewport.
OptionalscrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range centered vertically.
OptionalscrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.
OptionalscrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, optimized for viewing a code definition.
OptionalscrollType: ScrollTypeScroll 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.
OptionalscrollType: ScrollTypeSaves current view state of the editor in a serializable object.
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.
Set the primary position of the cursor. This will remove any secondary cursors.
New primary cursor's position
Optionalsource: string
Source of the call that caused the position
Change the scrollLeft of the editor's viewport.
OptionalscrollType: ScrollTypeChange the scroll position of the editor's viewport.
OptionalscrollType: ScrollTypeChange the scrollTop of the editor's viewport.
OptionalscrollType: ScrollTypeSet the primary selection of the editor. This will remove any secondary cursors.
The new selection
Optionalsource: string
Source of the call that caused the selection
Set the primary selection of the editor. This will remove any secondary cursors.
The new selection
Optionalsource: string
Source of the call that caused the selection
Set the primary selection of the editor. This will remove any secondary cursors.
The new selection
Optionalsource: string
Source of the call that caused the selection
Set the primary selection of the editor. This will remove any secondary cursors.
The new selection
Optionalsource: string
Source of the call that caused the selection
Set the selections for all the cursors of the editor. Cursors will be removed or added, as necessary.
The new selection
Optionalsource: string
Source of the call that caused the selection
Set the value of the current model attached to this editor.
Directly trigger a handler or an editor action.
The source of the call.
The id of the handler or the id of a contribution.
Extra data to be sent to the handler.
Update the editor's options after the editor has been created.
Write the screen reader content to be the current selection
ReadonlyonAn event emitted on a "contextmenu".
ReadonlyonAn event emitted when editing failed because the editor is read-only.
ReadonlyonAn event emitted when the text inside this editor lost focus (i.e. cursor stops blinking).
ReadonlyonAn event emitted when the text inside this editor or an editor widget lost focus.
ReadonlyonAn event emitted when the configuration of the editor has changed. (e.g. editor.updateOptions())
ReadonlyonAn event emitted when the cursor position has changed.
ReadonlyonAn event emitted when the cursor selection has changed.
ReadonlyonAn event emitted when hidden areas change in the editor (e.g. due to folding).
ReadonlyonAn event emitted when the model of this editor has changed (e.g. editor.setModel()).
ReadonlyonAn event emitted when the content of the current model has changed.
ReadonlyonAn event emitted when the decorations of the current model have changed.
ReadonlyonAn event emitted when the language of the current model has changed.
ReadonlyonAn event emitted when the language configuration of the current model has changed.
ReadonlyonAn event emitted when the options of the current model has changed.
ReadonlyonAn event emitted when the content width or content height in the editor has changed.
ReadonlyonAn event emitted when the text inside this editor gained focus (i.e. cursor starts blinking).
ReadonlyonAn event emitted when the text inside this editor or an editor widget gained focus.
ReadonlyonAn event emitted when the layout of the editor has changed.
ReadonlyonAn event emitted when users paste text in the editor.
ReadonlyonAn event emitted when the scroll in the editor has changed.
ReadonlyonAn event emitted on a "keydown".
ReadonlyonAn event emitted on a "keyup".
ReadonlyonAn event emitted on a "mousedown".
ReadonlyonAn event emitted on a "mouseleave".
ReadonlyonAn event emitted on a "mousemove".
ReadonlyonAn event emitted on a "mouseup".
ReadonlyonAn event emitted when the model of this editor is about to change (e.g. from editor.setModel()).
An event emitted when the editor has been disposed.
A rich code editor.