Constructor
new CodeMirrorWorker(mode)
#
Properties
mode :string
#
The mode for which the worker is created.
Type:
- string
- Source:
The mode for which the worker is created.
queue
#
Queue of callbacks to be called when the worker is loaded.
- Source:
Queue of callbacks to be called when the worker is loaded.
Methods
Get the configuration for the worker.
Get the localized messages for the worker.
lint(view) → {Promise}
#
Get lint diagnostics for the given document.
Parameters:
| Name | Type | Description |
|---|---|---|
view |
EditorView |
Returns:
- Type
- Promise
- Source:
Get lint diagnostics for the given document.
onload(callback)
#
Add a callback to be called when the worker is loaded.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
- Source:
Add a callback to be called when the worker is loaded.
setConfig(config)
#
Set the configuration for the worker.
setI18N(i18n)
#
Set the localized messages for the worker.
setLintConfig(config)
#
Set the linting configuration for the worker.
Parameters:
| Name | Type | Description |
|---|---|---|
config |
Object |
- Source:
Set the linting configuration for the worker.
pos(view, line, column) → {number}static
#
Calculate the position in the document for a given line and column.
Parameters:
| Name | Type | Description |
|---|---|---|
view |
EditorView | |
line |
number | |
column |
number |
Returns:
- Type
- number
- Source:
Calculate the position in the document for a given line and column.