Skip to content

Commit

Permalink
Use highlighting infrastructure from @codemirror/language
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Mar 30, 2022
1 parent 9d38543 commit 40fc1ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@codemirror/comment": "^0.19.0",
"@codemirror/fold": "^0.19.0",
"@codemirror/gutter": "^0.19.0",
"@codemirror/highlight": "^0.19.0",
"@codemirror/history": "^0.19.0",
"@codemirror/language": "^0.19.0",
"@codemirror/lint": "^0.19.0",
Expand Down
7 changes: 3 additions & 4 deletions src/basic-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {keymap, highlightSpecialChars, drawSelection, highlightActiveLine, dropC
import {Extension, EditorState} from "@codemirror/state"
import {history, historyKeymap} from "@codemirror/history"
import {foldGutter, foldKeymap} from "@codemirror/fold"
import {indentOnInput} from "@codemirror/language"
import {defaultHighlightStyle, syntaxHighlighting, indentOnInput} from "@codemirror/language"
import {lineNumbers, highlightActiveLineGutter} from "@codemirror/gutter"
import {defaultKeymap} from "@codemirror/commands"
import {bracketMatching} from "@codemirror/matchbrackets"
Expand All @@ -11,7 +11,6 @@ import {searchKeymap, highlightSelectionMatches} from "@codemirror/search"
import {autocompletion, completionKeymap} from "@codemirror/autocomplete"
import {commentKeymap} from "@codemirror/comment"
import {rectangularSelection, crosshairCursor} from "@codemirror/rectangular-selection"
import {defaultHighlightStyle} from "@codemirror/highlight"
import {lintKeymap} from "@codemirror/lint"

/// This is an extension value that just pulls together a whole lot of
Expand All @@ -30,7 +29,7 @@ import {lintKeymap} from "@codemirror/lint"
/// - [drop cursor](#view.dropCursor)
/// - [multiple selections](#state.EditorState^allowMultipleSelections)
/// - [reindentation on input](#language.indentOnInput)
/// - [the default highlight style](#highlight.defaultHighlightStyle) (as fallback)
/// - [the default highlight style](#language.defaultHighlightStyle) (as fallback)
/// - [bracket matching](#matchbrackets.bracketMatching)
/// - [bracket closing](#closebrackets.closeBrackets)
/// - [autocompletion](#autocomplete.autocompletion)
Expand Down Expand Up @@ -60,7 +59,7 @@ export const basicSetup: Extension = [
dropCursor(),
EditorState.allowMultipleSelections.of(true),
indentOnInput(),
defaultHighlightStyle.fallback,
syntaxHighlighting(defaultHighlightStyle, {fallback: true}),
bracketMatching(),
closeBrackets(),
autocompletion(),
Expand Down

0 comments on commit 40fc1ba

Please sign in to comment.