1 个不稳定版本
0.1.7 | 2023 年 3 月 10 日 |
---|
#197 在 #解析
13KB
149 行
highlight-assertions
读取用于 tree-sitter 高亮的单元测试格式 https://tree-sitter.github.io/tree-sitter/syntax-highlighting#unit-testing,以便为 https://github.com/nvim-treesitter/nvim-treesitter 的单元测试提供支持
解析文件格式的功能是从 https://github.com/tree-sitter/tree-sitter/blob/master/cli/src/query_testing.rs#L27-L124 转移的
使用方法
highlight-assertions 0.1.0
Stephan Seitz <stephan.seitz@fau.de>
Reads the unit test format for highlighting of tree-sitter https://tree-sitter.github.io/tree-
sitter/syntax-highlighting#unit-testing to make it available for unit test for
https://github.com/nvim-treesitter/nvim-treesitter. Output will be printed to stdout
USAGE:
highlight-assertions [OPTIONS] --parser-file <PARSER_FILE> --source-file <SOURCE_FILE>
OPTIONS:
-c, --comment-node <COMMENT_NODE>
Name of comment node in the language at hand [default: comment]
-h, --help
Print help information
-p, --parser-file <PARSER_FILE>
Parser library to load (e.g. cpp.so from nvim-treesitter/parser)
-s, --source-file <SOURCE_FILE>
Source file with highlight assertions following https://tree-sitter.github.io/tree-
sitter/syntax-highlighting#unit-testing
-V, --version
Print version information
输出将作为 JSON 打印到标准输出。
构建
由于 https://github.com/rust-lang/rust/issues/86319,此 crate 需要 nightly rust
cargo +nightly install --path .
依赖项
~4.5–6.5MB
~124K SLoC