Skip to content

Commit c2dfcc1

Browse files
authored
fix demo highlighting (#122)
Codemirror misbehaves when relevant package versions are out of sync, or if there are multiple versions of the same package being used. I updated all the packages to the latest versions, and [deduped](https://pnpm.io/cli/dedupe) to remove any duplicated package versions
1 parent 254afc0 commit c2dfcc1

File tree

5 files changed

+58
-66
lines changed

5 files changed

+58
-66
lines changed

.changeset/funny-ligers-call.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"codemirror-json-schema": patch
3+
---
4+
5+
fix demo highlighting

dev/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EditorState, StateEffect, StateField } from "@codemirror/state";
1+
import { EditorState } from "@codemirror/state";
22
import {
33
gutter,
44
EditorView,
@@ -8,9 +8,7 @@ import {
88
highlightActiveLineGutter,
99
ViewUpdate,
1010
} from "@codemirror/view";
11-
// import { basicSetup } from "@codemirror/basic-setup";
12-
import { lintGutter } from "@codemirror/lint";
13-
import { lintKeymap } from "@codemirror/lint";
11+
import { lintKeymap, lintGutter } from "@codemirror/lint";
1412
import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
1513
import {
1614
syntaxHighlighting,

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,28 @@
6969
"yaml": "^2.3.4"
7070
},
7171
"optionalDependencies": {
72-
"@codemirror/autocomplete": "^6.16.1",
72+
"@codemirror/autocomplete": "^6.16.2",
7373
"@codemirror/lang-json": "^6.0.1",
74-
"@codemirror/lang-yaml": "^6.0.0",
74+
"@codemirror/lang-yaml": "^6.1.1",
7575
"codemirror-json5": "^1.0.3",
7676
"json5": "^2.2.3"
7777
},
7878
"peerDependencies": {
79-
"@codemirror/language": "^6.8.0",
80-
"@codemirror/lint": "^6.4.0",
81-
"@codemirror/state": "^6.2.1",
82-
"@codemirror/view": "^6.14.1",
83-
"@lezer/common": "^1.0.3"
79+
"@codemirror/language": "^6.10.2",
80+
"@codemirror/lint": "^6.8.0",
81+
"@codemirror/state": "^6.4.1",
82+
"@codemirror/view": "^6.27.0",
83+
"@lezer/common": "^1.2.1"
8484
},
8585
"devDependencies": {
8686
"@changesets/cli": "^2.26.2",
8787
"@codemirror/autocomplete": "^6.16.2",
88-
"@codemirror/commands": "^6.5.0",
89-
"@codemirror/language": "^6.10.1",
88+
"@codemirror/commands": "^6.6.0",
89+
"@codemirror/language": "^6.10.2",
9090
"@codemirror/lint": "^6.8.0",
9191
"@codemirror/state": "^6.4.1",
9292
"@codemirror/theme-one-dark": "^6.1.2",
93-
"@codemirror/view": "^6.26.3",
93+
"@codemirror/view": "^6.27.0",
9494
"@evilmartians/lefthook": "^1.4.6",
9595
"@lezer/common": "^1.2.1",
9696
"@types/markdown-it": "^13.0.7",

pnpm-lock.yaml

Lines changed: 40 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/features/validation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class JSONValidation {
128128
const text = view.state.doc.toString();
129129

130130
// ignore blank json strings
131-
if (!text || !text.length) return [];
131+
if (!text?.length) return [];
132132

133133
const json = this.parser(view.state);
134134

0 commit comments

Comments
 (0)