gradio/js/code/interactive/extensions.ts
pngwn ae4277a9a8
move files (#3605)
* move files

* commit the rest of the files

* fix lockfile

* fix workflow

* fix type errors

* fix tests

* only run ci when certain files change

* run correct test command in ci

* version

* fix pypi script

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-27 16:12:58 -07:00

49 lines
1.1 KiB
TypeScript

import type { Extension } from "@codemirror/state";
import {
lineNumbers,
highlightSpecialChars,
drawSelection,
rectangularSelection,
crosshairCursor,
keymap
} from "@codemirror/view";
export { EditorView } from "@codemirror/view";
import { EditorState } from "@codemirror/state";
import {
foldGutter,
indentOnInput,
syntaxHighlighting,
defaultHighlightStyle,
foldKeymap
} from "@codemirror/language";
import { history, defaultKeymap, historyKeymap } from "@codemirror/commands";
import {
closeBrackets,
closeBracketsKeymap,
completionKeymap
} from "@codemirror/autocomplete";
import { lintKeymap } from "@codemirror/lint";
export const basicSetup: Extension = /*@__PURE__*/ (() => [
lineNumbers(),
highlightSpecialChars(),
history(),
foldGutter(),
drawSelection(),
EditorState.allowMultipleSelections.of(true),
indentOnInput(),
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
closeBrackets(),
rectangularSelection(),
crosshairCursor(),
keymap.of([
...closeBracketsKeymap,
...defaultKeymap,
...historyKeymap,
...foldKeymap,
...completionKeymap,
...lintKeymap
])
])();