mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
1419538ea7
* asd * changes * fix everything * cleanup * add changeset * fix casing * lockfile * fix casing * fix ci, enable linting * fix test * add changeset * add changeset * delete changeset * fix dirs * fix casing * fix notebooks * fix casing * fix casing * fix casing * fix casing * fix casing * fix casing * fix casing * fix casing --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
49 lines
1.1 KiB
TypeScript
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__*/ ((): Extension[] => [
|
|
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
|
|
])
|
|
])();
|