mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-12 14:25:06 +00:00
197b5649ff
Autocomplete magic words, tag names and url protocols. This patch also enables block comment using `<!-- -->`. Bug: T95100 Change-Id: If37da956ac1eb945b96753e6728c0247b1a68b66
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;
|