Debounce autocomplete

This commit is contained in:
Gregory Schier
2023-03-08 11:25:20 -08:00
parent 657c6ad9a9
commit f976397283
12 changed files with 117 additions and 33 deletions

View File

@@ -33,6 +33,7 @@ import {
rectangularSelection,
} from '@codemirror/view';
import { tags as t } from '@lezer/highlight';
import { debouncedAutocompletionDisplay } from './autocomplete';
import { twig } from './twig/extension';
import { url } from './url/extension';
@@ -107,7 +108,8 @@ export const baseExtensions = [
drawSelection(),
dropCursor(),
bracketMatching(),
autocompletion({ closeOnBlur: true, interactionDelay: 200 }),
debouncedAutocompletionDisplay({ millis: 1000 }),
autocompletion({ closeOnBlur: true, interactionDelay: 200, activateOnTyping: false }),
syntaxHighlighting(myHighlightStyle),
EditorState.allowMultipleSelections.of(true),
];