The monaco editor object. This is the actual monaco editor object. It is exposed for advanced usage, but mind the fact that editor might be swapped in the future for a different library, so use on your own responsibility. For more information see monaco editor API.
Provides the current model of the editor. For advanced usage. Bare in mind that in case of the monaco library being swapped in the future, this might not be available. For more information see monaco editor model API.
Provides the current position of the cursor.
Provides positions of all the secondary cursors.
The addEventListener()
method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optional
options: boolean | AddEventListenerOptionsCallback method called when context is resolved.
Reference to the created Context Consumer Controller instance
The dispatchEvent()
method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
Looks for a string or matching strings in the editor and returns the ranges of the found strings. Can use regex, case sensitive and more. If you want regex set the isRegex to true in the options.
Optional
searchOptions: CodeEditorSearchOptions = ...{UmbCodeEditorRange[]}
Optional
options: UmbClassGetContextOptionsA Promise with the reference to the Context Api Instance
Provides the current positions of the cursor or multiple cursors.
{(UmbCodeEditorCursorPosition | null)}
Provides the current selections of the editor.
{UmbCodeEditorSelection[]}
Returns the value of the editor for a given range.
{string}
Inserts text at a given position.
An Observable to observe from.
Optional
callback: ObserverCallback<SpecificT>Callback method called when data is changed.
Optional
controllerAlias: null | UmbControllerAliasDefine an explicit controller alias. If not defined then one will be generated based on the callback function. If null is parsed no controller alias will be given.
Reference to the created Observer Controller instance.
Runs callback on change of cursor position. Gives as parameter the new position.
Runs callback on change of cursor selection. Gives as parameter the new selection.
The API instance to be exposed.
Reference to the created Context Provider Controller instance
The removeEventListener()
method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
Optional
options: boolean | EventListenerOptionsChanges the theme of the editor.
Updates the options of the editor. This is useful for updating the options after the editor has been created.
This is a wrapper class for the monaco editor. It exposes some of the monaco editor API. It also handles the creation of the monaco editor. It allows access to the entire monaco editor object through
monacoEditor
property, but mind the fact that editor might be swapped in the future for a different library, so use on your own responsibility. Through the UmbCodeEditorHost interface it can be used in a custom element. By using monaco library directly you can access the entire monaco API along with code completions, actions etc. This class creates some level of abstraction over the monaco editor. It only provides basic functionality, that should be enough for most of the use cases and should be possible to implement with any code editor library.Current issues: shadow DOM related issues #3217 currently fixed by a hack , razor syntax highlight UmbCodeEditor