pax_global_header00006660000000000000000000000064143254765120014523gustar00rootroot0000000000000052 comment=f64ee9d394ec7ea1fd2ad16780948f71162ee86a
lang-rust-6.0.1/000077500000000000000000000000001432547651200134435ustar00rootroot00000000000000lang-rust-6.0.1/.github/000077500000000000000000000000001432547651200150035ustar00rootroot00000000000000lang-rust-6.0.1/.github/workflows/000077500000000000000000000000001432547651200170405ustar00rootroot00000000000000lang-rust-6.0.1/.github/workflows/dispatch.yml000066400000000000000000000006371432547651200213700ustar00rootroot00000000000000name: Trigger CI
on: push
jobs:
build:
name: Dispatch to main repo
runs-on: ubuntu-latest
steps:
- name: Emit repository_dispatch
uses: mvasigh/dispatch-action@main
with:
# You should create a personal access token and store it in your repository
token: ${{ secrets.DISPATCH_AUTH }}
repo: dev
owner: codemirror
event_type: push
lang-rust-6.0.1/.gitignore000066400000000000000000000001271432547651200154330ustar00rootroot00000000000000/node_modules
package-lock.json
/dist
/test/*.js
/test/*.d.ts
/test/*.d.ts.map
.tern-*
lang-rust-6.0.1/.npmignore000066400000000000000000000001001432547651200154310ustar00rootroot00000000000000/src
/test
/node_modules
.tern-*
rollup.config.js
tsconfig.json
lang-rust-6.0.1/CHANGELOG.md000066400000000000000000000014561432547651200152620ustar00rootroot00000000000000## 6.0.1 (2022-10-24)
### Bug fixes
Allow prefixed strings to be closed by `closeBrackets`.
## 6.0.0 (2022-06-08)
### Breaking changes
Update dependencies to 6.0.0
## 0.20.0 (2022-04-20)
### Breaking changes
Update dependencies to 0.20.0
## 0.19.2 (2022-03-21)
### Bug fixes
Add syntax highlighting for character literals
Make sure the editor doesn't indent statements with attributes before them.
## 0.19.1 (2021-08-11)
### Bug fixes
Fix incorrect versions for @lezer dependencies.
## 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)
### New features
The package now also exports a CommonJS module.
## 0.17.0 (2020-12-29)
### Breaking changes
First numbered release.
lang-rust-6.0.1/LICENSE000066400000000000000000000021301432547651200144440ustar00rootroot00000000000000MIT License
Copyright (C) 2018-2021 by Marijn Haverbeke and others
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
lang-rust-6.0.1/README.md000066400000000000000000000032271432547651200147260ustar00rootroot00000000000000
# @codemirror/lang-rust [](https://www.npmjs.org/package/@codemirror/lang-rust)
[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-rust/blob/main/CHANGELOG.md) ]
This package implements Rust language support for the
[CodeMirror](https://codemirror.net/) code editor.
The [project page](https://codemirror.net/) has more information, a
number of [examples](https://codemirror.net/examples/) and the
[documentation](https://codemirror.net/docs/).
This code is released under an
[MIT license](https://github.com/codemirror/lang-rust/tree/main/LICENSE).
We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.
## API Reference
A syntax provider based on the Lezer Rust
parser, extended with
highlighting and indentation information.
lang-rust-6.0.1/package.json000066400000000000000000000015721432547651200157360ustar00rootroot00000000000000{
"name": "@codemirror/lang-rust",
"version": "6.0.1",
"description": "Rust language support for the CodeMirror code editor",
"scripts": {
"test": "cm-runtests",
"prepare": "cm-buildhelper src/rust.ts"
},
"keywords": [
"editor",
"code"
],
"author": {
"name": "Marijn Haverbeke",
"email": "marijnh@gmail.com",
"url": "http://marijnhaverbeke.nl"
},
"type": "module",
"main": "dist/index.cjs",
"exports": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"types": "dist/index.d.ts",
"module": "dist/index.js",
"sideEffects": false,
"license": "MIT",
"dependencies": {
"@codemirror/language": "^6.0.0",
"@lezer/rust": "^1.0.0"
},
"devDependencies": {
"@codemirror/buildhelper": "^0.1.0"
},
"repository": {
"type": "git",
"url": "https://github.com/codemirror/lang-rust.git"
}
}
lang-rust-6.0.1/src/000077500000000000000000000000001432547651200142325ustar00rootroot00000000000000lang-rust-6.0.1/src/README.md000066400000000000000000000020741432547651200155140ustar00rootroot00000000000000
# @codemirror/lang-rust [](https://www.npmjs.org/package/@codemirror/lang-rust)
[ [**WEBSITE**](https://codemirror.net/6/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-rust/blob/main/CHANGELOG.md) ]
This package implements Rust language support for the
[CodeMirror](https://codemirror.net/6/) code editor.
The [project page](https://codemirror.net/6/) has more information, a
number of [examples](https://codemirror.net/6/examples/) and the
[documentation](https://codemirror.net/6/docs/).
This code is released under an
[MIT license](https://github.com/codemirror/lang-rust/tree/main/LICENSE).
We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.
## API Reference
@rust
@rustLanguage
lang-rust-6.0.1/src/rust.ts000066400000000000000000000022511432547651200155770ustar00rootroot00000000000000import {parser} from "@lezer/rust"
import {continuedIndent, indentNodeProp, foldNodeProp, foldInside, LRLanguage, LanguageSupport} from "@codemirror/language"
/// A syntax provider based on the [Lezer Rust
/// parser](https://github.com/lezer-parser/rust), extended with
/// highlighting and indentation information.
export const rustLanguage = LRLanguage.define({
name: "rust",
parser: parser.configure({
props: [
indentNodeProp.add({
IfExpression: continuedIndent({except: /^\s*({|else\b)/}),
"String BlockComment": () => null,
"AttributeItem": cx => cx.continue(),
"Statement MatchArm": continuedIndent()
}),
foldNodeProp.add(type => {
if (/(Block|edTokens|List)$/.test(type.name)) return foldInside
if (type.name == "BlockComment") return tree => ({from: tree.from + 2, to: tree.to - 2})
return undefined
})
]
}),
languageData: {
commentTokens: {line: "//", block: {open: "/*", close: "*/"}},
indentOnInput: /^\s*(?:\{|\})$/,
closeBrackets: {stringPrefixes: ["b", "r", "br"]}
}
})
/// Rust language support
export function rust() {
return new LanguageSupport(rustLanguage)
}