@codemirror/lang-rust
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,6 +0,14 @@ | ||
import { LezerLanguage, LanguageSupport } from '@codemirror/language'; | ||
import { LRLanguage, LanguageSupport } from '@codemirror/language'; | ||
declare const rustLanguage: LezerLanguage; | ||
/** | ||
A syntax provider based on the [Lezer Rust | ||
parser](https://github.com/lezer-parser/rust), extended with | ||
highlighting and indentation information. | ||
*/ | ||
declare const rustLanguage: LRLanguage; | ||
/** | ||
Rust language support | ||
*/ | ||
declare function rust(): LanguageSupport; | ||
export { rust, rustLanguage }; |
@@ -1,17 +0,19 @@ | ||
import { parser } from 'lezer-rust'; | ||
import { LezerLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language'; | ||
import { parser } from '@lezer/rust'; | ||
import { LRLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language'; | ||
import { styleTags, tags } from '@codemirror/highlight'; | ||
/// A syntax provider based on the [Lezer Rust | ||
/// parser](https://github.com/lezer-parser/rust), extended with | ||
/// highlighting and indentation information. | ||
const rustLanguage = LezerLanguage.define({ | ||
parser: parser.configure({ | ||
/** | ||
A syntax provider based on the [Lezer Rust | ||
parser](https://github.com/lezer-parser/rust), extended with | ||
highlighting and indentation information. | ||
*/ | ||
const rustLanguage = /*@__PURE__*/LRLanguage.define({ | ||
parser: /*@__PURE__*/parser.configure({ | ||
props: [ | ||
indentNodeProp.add({ | ||
IfExpression: continuedIndent({ except: /^\s*({|else\b)/ }), | ||
/*@__PURE__*/indentNodeProp.add({ | ||
IfExpression: /*@__PURE__*/continuedIndent({ except: /^\s*({|else\b)/ }), | ||
"String BlockComment": () => -1, | ||
"Statement MatchArm": continuedIndent() | ||
"Statement MatchArm": /*@__PURE__*/continuedIndent() | ||
}), | ||
foldNodeProp.add(type => { | ||
/*@__PURE__*/foldNodeProp.add(type => { | ||
if (/(Block|edTokens|List)$/.test(type.name)) | ||
@@ -23,3 +25,3 @@ return foldInside; | ||
}), | ||
styleTags({ | ||
/*@__PURE__*/styleTags({ | ||
"const macro_rules mod struct union enum type fn impl trait let use crate static": tags.definitionKeyword, | ||
@@ -32,11 +34,11 @@ "pub unsafe async mut extern default move": tags.modifier, | ||
String: tags.string, | ||
RawString: tags.special(tags.string), | ||
RawString: /*@__PURE__*/tags.special(tags.string), | ||
Boolean: tags.bool, | ||
Identifier: tags.variableName, | ||
"CallExpression/Identifier": tags.function(tags.variableName), | ||
BoundIdentifier: tags.definition(tags.variableName), | ||
"CallExpression/Identifier": /*@__PURE__*/tags.function(tags.variableName), | ||
BoundIdentifier: /*@__PURE__*/tags.definition(tags.variableName), | ||
LoopLabel: tags.labelName, | ||
FieldIdentifier: tags.propertyName, | ||
"CallExpression/FieldExpression/FieldIdentifier": tags.function(tags.propertyName), | ||
Lifetime: tags.special(tags.variableName), | ||
"CallExpression/FieldExpression/FieldIdentifier": /*@__PURE__*/tags.function(tags.propertyName), | ||
Lifetime: /*@__PURE__*/tags.special(tags.variableName), | ||
ScopeIdentifier: tags.namespace, | ||
@@ -72,3 +74,5 @@ TypeIdentifier: tags.typeName, | ||
}); | ||
/// Rust language support | ||
/** | ||
Rust language support | ||
*/ | ||
function rust() { | ||
@@ -75,0 +79,0 @@ return new LanguageSupport(rustLanguage); |
{ | ||
"name": "@codemirror/lang-rust", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"description": "Rust 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/rust.ts" | ||
}, | ||
@@ -29,10 +29,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@codemirror/highlight": "^0.18.0", | ||
"@codemirror/language": "^0.18.0", | ||
"lezer-rust": "^0.13.0" | ||
"@codemirror/highlight": "^0.19.0", | ||
"@codemirror/language": "^0.19.0", | ||
"@lezer/rust": "^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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
2
12446
8
169
+ Added@lezer/rust@^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-rust@^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-rust@0.13.1(transitive)
- Removedlezer-tree@0.13.2(transitive)
Updated@codemirror/language@^0.19.0