Properties
veSupportedExtensions :Array.<string>
#
Allowlist of names of CodeMirror extensions supported by the 2017 wikitext editor. Do not include Extensions that make changes to the document text, or visually change the placement of text.
Note also that there is no UI to toggle or reconfigure CodeMirror Extensions in VE.
Type:
- Array.<string>
- Source:
Methods
get(name) → {Extension|undefined
}
#
undefined
}
#
Get the compartmentalized Extension
with the given name.
This should only be used when including registered extensions during
CodeMirror initialization such as with CodeMirrorPreferences#extension
.
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
- Source:
Returns:
- Type
-
Extension
|
undefined
Extension
with the given name.
getCompartment(name) → {Compartment|undefined
}
#
undefined
}
#
Get the Compartment
for the extension with the given name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
- Source:
Returns:
- Type
-
Compartment
|
undefined
Compartment
for the extension with the given name.
isEnabled(name, view) → {boolean}
#
Check if an extension is enabled.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
view |
EditorView |
- Source:
Returns:
- Type
- boolean
isRegistered(name, view) → {boolean}
#
Check if the Extension
with the given name has been appended to the
EditorState
configuration. In the context of CodeMirror, this means
that the extension has been "registered", but not necessarily enabled.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
view |
EditorView |
- Source:
Returns:
- Type
- boolean
Check if the Extension
with the given name has been appended to the
EditorState
configuration.
reconfigure(name, view, extension)
#
Reconfigure a compartmentalized extension with a new Extension
.
Example
const cm = new CodeMirror( ... );
// Register an Extension that sets the tab size to 5 spaces.
cm.extensionRegistry.register( 'tabSize', EditorState.tabSize.of( 5 ), cm.view, true );
// Reconfigure the tab size to 10 spaces.
cm.extensionRegistry.reconfigure( 'tabSize', cm.view, EditorState.tabSize.of( 10 ) );
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
view |
EditorView | |
extension |
Extension |
- Source:
Extension
.
register(name, extension, view, [enable])
#
Register an Extension
, creating a corresponding Compartment
.
The Extension can then be reconfigured
such as toggling
on and off.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
extension |
Extension | ||
view |
EditorView | ||
enable |
boolean |
optional |
|
- Source:
Extension
, creating a corresponding Compartment
.
toggle(name, view, [force])
#
Toggle on or off an extension.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
view |
EditorView | ||
force |
boolean |
optional |
|
- Source: