mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 22:03:28 +00:00
21 lines
485 B
JavaScript
21 lines
485 B
JavaScript
|
const {
|
||
|
autocompletion,
|
||
|
acceptCompletion,
|
||
|
keymap
|
||
|
} = require( 'ext.CodeMirror.v6.lib' );
|
||
|
|
||
|
/**
|
||
|
* CodeMirror extension providing
|
||
|
* autocompletion
|
||
|
* for the MediaWiki mode. This automatically applied when using {@link CodeMirrorModeMediaWiki}.
|
||
|
*
|
||
|
* @module CodeMirrorAutocomplete
|
||
|
* @type {Extension}
|
||
|
*/
|
||
|
const autocompleteExtension = [
|
||
|
autocompletion( { defaultKeymap: true } ),
|
||
|
keymap.of( [ { key: 'Tab', run: acceptCompletion } ] )
|
||
|
];
|
||
|
|
||
|
module.exports = autocompleteExtension;
|