tree-sitter-rust
tree-sitter-rust copied to clipboard
Rust grammar for tree-sitter
The following Rust code ```rust fn foo() { if true {} } ``` produces the following parse tree (as formatted by [nvim-treesitter/playground](https://github.com/nvim-treesitter/playground)): ``` function_item [0, 0] - [2, 1] name:...
:warning: Depends on https://github.com/tree-sitter/tree-sitter/pull/1635. Don't merge yet. ⚠️
in the example `let x = 0;`, `x` isnt considered anything. same would be for any usages of `x`. these should be considered. I am not sure if this is...
I'm unsure when this happened in the commits, I have treesitter update everyday, so I believe it has been since last night. I'm also unsure if this has to do...
The nightly version of rust supports try blocks, with this sort of syntax: ```rust let n = try { do_stuff(); 5 }; ``` It is pretty much the same as...
I noticed when testing #93 that `npm test` reports errors in parsing several of the example files: ``` examples/regex/regex-syntax/src/ast/parse.rs 17 ms (ERROR [1737, 22] - [1737, 27]) examples/regex/regex-syntax/src/hir/interval.rs 1 ms...
Motivation: https://github.com/andymass/vim-matchup/pull/140 -- see the query file https://github.com/andymass/vim-matchup/pull/140/files#diff-d74a0aa0bf2225f5b3d440f88938de06c9c0373c035643ba22aed5a34d5ffcc5 for the specific queries. Before, it looked like this: ``` if ... { } else if let ... = ... { }...
The [format_args_capture](https://rust-lang.github.io/rfcs/2795-format-args-implicit-identifiers.html) was stabilized in [1.58.0](https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html#captured-identifiers-in-format-strings). It would be nice to resolve the captured identifiers.
`npm run test` confused me when I tried to run it locally: > Successfully parsed 0 of 1 example files (0.0%) I thought it got broken due to a change...
It would be a nice enhancement if doc string comments would be parsed, to provide better highlights when documenting code