Skip to content

Commit

Permalink
fix demo highlighting (#122)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
imolorhe authored Jun 5, 2024
1 parent 254afc0 commit c2dfcc1
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 66 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-ligers-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"codemirror-json-schema": patch
---

fix demo highlighting
6 changes: 2 additions & 4 deletions dev/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EditorState, StateEffect, StateField } from "@codemirror/state";
import { EditorState } from "@codemirror/state";
import {
gutter,
EditorView,
Expand All @@ -8,9 +8,7 @@ import {
highlightActiveLineGutter,
ViewUpdate,
} from "@codemirror/view";
// import { basicSetup } from "@codemirror/basic-setup";
import { lintGutter } from "@codemirror/lint";
import { lintKeymap } from "@codemirror/lint";
import { lintKeymap, lintGutter } from "@codemirror/lint";
import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
import {
syntaxHighlighting,
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,28 @@
"yaml": "^2.3.4"
},
"optionalDependencies": {
"@codemirror/autocomplete": "^6.16.1",
"@codemirror/autocomplete": "^6.16.2",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-yaml": "^6.0.0",
"@codemirror/lang-yaml": "^6.1.1",
"codemirror-json5": "^1.0.3",
"json5": "^2.2.3"
},
"peerDependencies": {
"@codemirror/language": "^6.8.0",
"@codemirror/lint": "^6.4.0",
"@codemirror/state": "^6.2.1",
"@codemirror/view": "^6.14.1",
"@lezer/common": "^1.0.3"
"@codemirror/language": "^6.10.2",
"@codemirror/lint": "^6.8.0",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.27.0",
"@lezer/common": "^1.2.1"
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@codemirror/autocomplete": "^6.16.2",
"@codemirror/commands": "^6.5.0",
"@codemirror/language": "^6.10.1",
"@codemirror/commands": "^6.6.0",
"@codemirror/language": "^6.10.2",
"@codemirror/lint": "^6.8.0",
"@codemirror/state": "^6.4.1",
"@codemirror/theme-one-dark": "^6.1.2",
"@codemirror/view": "^6.26.3",
"@codemirror/view": "^6.27.0",
"@evilmartians/lefthook": "^1.4.6",
"@lezer/common": "^1.2.1",
"@types/markdown-it": "^13.0.7",
Expand Down
91 changes: 40 additions & 51 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/features/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class JSONValidation {
const text = view.state.doc.toString();

// ignore blank json strings
if (!text || !text.length) return [];
if (!text?.length) return [];

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

Expand Down

0 comments on commit c2dfcc1

Please sign in to comment.