Expand all

CodeMirrorWorker

Web worker for CodeMirror

Constructor

new CodeMirrorWorker(lang) #

Parameters:

Name Type Description
lang string
Source:

Properties

lang :string #

The language for which the worker is created.

Type:

  • string
Source:
The language for which the worker is created.

worker :Worker #

The web worker for the language.

Type:

Source:
The web worker for the language.

Methods

getConfig() → {Promise} #

Get the configuration for the worker.

Source:

Returns:

Type
Promise
Get the configuration for the worker.

lint(view) → {Promise} #

Get lint diagnostics for the given document.

Parameters:

Name Type Description
view EditorView
Source:

Returns:

Type
Promise
Get lint diagnostics for the given document.

setConfig(config) #

Set the configuration for the worker.

Parameters:

Name Type Description
config Object
Source:
Set the 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
Source:

Returns:

Type
number
Calculate the position in the document for a given line and column.