@@ -43,6 +43,8 @@ import {type YfmLangOptions, yfmLang} from './yfm';
4343
4444export type { YfmLangOptions } ;
4545
46+ type Autocompletion = Parameters < typeof autocompletion > [ 0 ] ;
47+
4648export type CreateCodemirrorParams = {
4749 doc : EditorViewConfig [ 'doc' ] ;
4850 placeholderText : string ;
@@ -61,6 +63,7 @@ export type CreateCodemirrorParams = {
6163 keymaps ?: readonly KeyBinding [ ] ;
6264 receiver ?: Receiver < EventMap > ;
6365 yfmLangOptions ?: YfmLangOptions ;
66+ autocompletion ?: Autocompletion ;
6467} ;
6568
6669export function createCodemirror ( params : CreateCodemirrorParams ) {
@@ -78,6 +81,7 @@ export function createCodemirror(params: CreateCodemirrorParams) {
7881 keymaps = [ ] ,
7982 receiver,
8083 yfmLangOptions,
84+ autocompletion : autocompletionConfig ,
8185 } = params ;
8286
8387 const extensions : Extension [ ] = [ gravityTheme , placeholder ( placeholderText ) ] ;
@@ -126,7 +130,7 @@ export function createCodemirror(params: CreateCodemirrorParams) {
126130 ...( disabledExtensions . history ? [ ] : historyKeymap ) ,
127131 ...keymaps ,
128132 ] ) ,
129- autocompletion ( ) ,
133+ autocompletion ( autocompletionConfig ) ,
130134 yfmLang ( yfmLangOptions ) ,
131135 ReactRendererFacet . of ( reactRenderer ) ,
132136 PairingCharactersExtension ,
0 commit comments