Skip to content

Commit

Permalink
Adjust to new highlighting interface
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Mar 23, 2022
1 parent 3f6f4e7 commit 6d1af2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"sideEffects": false,
"license": "MIT",
"dependencies": {
"@codemirror/highlight": "^0.19.0",
"@lezer/highlight": "^0.15.0",
"@codemirror/language": "^0.19.0",
"@codemirror/state": "^0.19.0",
"@codemirror/view": "^0.19.0"
},
Expand Down
5 changes: 3 additions & 2 deletions src/one-dark.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {EditorView} from "@codemirror/view"
import {Extension} from "@codemirror/state"
import {HighlightStyle, tags as t} from "@codemirror/highlight"
import {HighlightStyle, syntaxHighlighting} from "@codemirror/language"
import {tags as t} from "@lezer/highlight"

// Using https://github.com/one-dark/vscode-one-dark-theme/ as reference for the colors

Expand Down Expand Up @@ -131,4 +132,4 @@ export const oneDarkHighlightStyle = HighlightStyle.define([

/// Extension to enable the One Dark theme (both the editor theme and
/// the highlight style).
export const oneDark: Extension = [oneDarkTheme, oneDarkHighlightStyle]
export const oneDark: Extension = [oneDarkTheme, syntaxHighlighting(oneDarkHighlightStyle)]

0 comments on commit 6d1af2c

Please sign in to comment.