mediawiki-extensions-CodeMi.../resources/codemirror.mediawiki.autocomplete.js

21 lines
485 B
JavaScript
Raw Permalink Normal View History

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;