mediawiki-extensions-CodeMi.../resources/codemirror.mediawiki.autocomplete.js
bhsd 197b5649ff CodeMirrorModeMediaWiki: autocompletion
Autocomplete magic words, tag names and url protocols. This patch also enables block comment using `<!-- -->`.

Bug: T95100
Change-Id: If37da956ac1eb945b96753e6728c0247b1a68b66
2024-11-19 16:02:35 +08:00

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;