@codemirror/lang-json
Advanced tools
Comparing version 0.18.0 to 0.19.0
@@ -0,3 +1,13 @@ | ||
## 0.19.0 (2021-08-11) | ||
### Breaking changes | ||
Update dependencies to 0.19.0 | ||
## 0.18.0 (2021-03-03) | ||
### Breaking changes | ||
Update dependencies to 0.18. | ||
## 0.17.1 (2021-01-06) | ||
@@ -4,0 +14,0 @@ |
@@ -1,10 +0,22 @@ | ||
import { LezerLanguage, LanguageSupport } from '@codemirror/language'; | ||
import { LRLanguage, LanguageSupport } from '@codemirror/language'; | ||
import { Diagnostic } from '@codemirror/lint'; | ||
import { EditorView } from '@codemirror/view'; | ||
/** | ||
Calls | ||
[`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) | ||
on the document and, if that throws an error, reports it as a | ||
single diagnostic. | ||
*/ | ||
declare const jsonParseLinter: () => (view: EditorView) => Diagnostic[]; | ||
declare const jsonLanguage: LezerLanguage; | ||
/** | ||
A language provider that provides JSON parsing. | ||
*/ | ||
declare const jsonLanguage: LRLanguage; | ||
/** | ||
JSON language support. | ||
*/ | ||
declare function json(): LanguageSupport; | ||
export { json, jsonLanguage, jsonParseLinter }; |
@@ -1,9 +0,11 @@ | ||
import { parser } from 'lezer-json'; | ||
import { LezerLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language'; | ||
import { parser } from '@lezer/json'; | ||
import { LRLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language'; | ||
import { styleTags, tags } from '@codemirror/highlight'; | ||
/// Calls | ||
/// [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) | ||
/// on the document and, if that throws an error, reports it as a | ||
/// single diagnostic. | ||
/** | ||
Calls | ||
[`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) | ||
on the document and, if that throws an error, reports it as a | ||
single diagnostic. | ||
*/ | ||
const jsonParseLinter = () => (view) => { | ||
@@ -35,14 +37,16 @@ try { | ||
/// A language provider that provides JSON parsing. | ||
const jsonLanguage = LezerLanguage.define({ | ||
parser: parser.configure({ | ||
/** | ||
A language provider that provides JSON parsing. | ||
*/ | ||
const jsonLanguage = /*@__PURE__*/LRLanguage.define({ | ||
parser: /*@__PURE__*/parser.configure({ | ||
props: [ | ||
indentNodeProp.add({ | ||
Object: continuedIndent({ except: /^\s*\}/ }), | ||
Array: continuedIndent({ except: /^\s*\]/ }) | ||
/*@__PURE__*/indentNodeProp.add({ | ||
Object: /*@__PURE__*/continuedIndent({ except: /^\s*\}/ }), | ||
Array: /*@__PURE__*/continuedIndent({ except: /^\s*\]/ }) | ||
}), | ||
foldNodeProp.add({ | ||
/*@__PURE__*/foldNodeProp.add({ | ||
"Object Array": foldInside | ||
}), | ||
styleTags({ | ||
/*@__PURE__*/styleTags({ | ||
String: tags.string, | ||
@@ -64,3 +68,5 @@ Number: tags.number, | ||
}); | ||
/// JSON language support. | ||
/** | ||
JSON language support. | ||
*/ | ||
function json() { | ||
@@ -67,0 +73,0 @@ return new LanguageSupport(jsonLanguage); |
{ | ||
"name": "@codemirror/lang-json", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"description": "JSON language support for the CodeMirror code editor", | ||
"scripts": { | ||
"test": "echo 'No tests'", | ||
"prepare": "tsc -p tsconfig.local.json && rollup -c" | ||
"test": "cm-runtests", | ||
"prepare": "cm-buildhelper src/json.ts" | ||
}, | ||
@@ -29,10 +29,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@codemirror/highlight": "^0.18.0", | ||
"@codemirror/language": "^0.18.0", | ||
"lezer-json": "^0.13.0" | ||
"@codemirror/highlight": "^0.19.0", | ||
"@codemirror/language": "^0.19.0", | ||
"@lezer/json": "^0.14.0" | ||
}, | ||
"devDependencies": { | ||
"rollup": "^2.35.1", | ||
"rollup-plugin-dts": "^2.0.1", | ||
"typescript": "^4.1.3" | ||
"@codemirror/buildhelper": "^0.1.0" | ||
}, | ||
@@ -39,0 +37,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
1
165
2
10369
8
+ Added@lezer/json@^0.14.0
+ Added@codemirror/highlight@0.19.8(transitive)
+ Added@codemirror/language@0.19.10(transitive)
+ Added@codemirror/rangeset@0.19.9(transitive)
+ Added@codemirror/state@0.19.9(transitive)
+ Added@codemirror/text@0.19.6(transitive)
+ Added@codemirror/view@0.19.48(transitive)
+ Added@lezer/common@0.15.12(transitive)
+ Added@lezer/lr@0.15.8(transitive)
- Removedlezer-json@^0.13.0
- Removed@codemirror/highlight@0.18.4(transitive)
- Removed@codemirror/language@0.18.2(transitive)
- Removed@codemirror/rangeset@0.18.5(transitive)
- Removed@codemirror/state@0.18.7(transitive)
- Removed@codemirror/text@0.18.1(transitive)
- Removed@codemirror/view@0.18.19(transitive)
- Removedlezer@0.13.5(transitive)
- Removedlezer-json@0.13.2(transitive)
- Removedlezer-tree@0.13.2(transitive)
Updated@codemirror/language@^0.19.0