tree-sitter-rust
tree-sitter-c
tree-sitter-rust | tree-sitter-c | |
---|---|---|
8 | 7 | |
372 | 253 | |
2.7% | 3.2% | |
7.8 | 8.1 | |
about 1 month ago | 21 days ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
tree-sitter-rust
-
Topiary: A code formatting engine leveraging Tree-sitter
Yes. It's typically a fair bit slower than a hand-coded parser. The idea sounds great until you're working on a codebase with 2 million LOC. At that point, the speed of a cold parse is most important, whereas TS is designed for fast re-parsing of a single file. These aren't great numbers but the Rust TS parser is reportedly 2x slower than rustc's https://github.com/tree-sitter/tree-sitter-rust. It's no surprise that you just use the faster option if it's convenient.
- Emacs and Java Development: Corfu + Cape + LSP-Mode + Treesit
- Treesitter large file performance... Even with everything disabled?
- Building tree-sitter languages for Emacs
-
Is it possible to have Rust doc test comments highlighted in Neovim?
Notes for anyone interested, there is this PR https://github.com/tree-sitter/tree-sitter-rust/pull/128, which merges successive doc comments.
-
Rust and Neovim - A Thorough Guide and Walkthrough
Tree-sitter is a fantastic parser generation and incremental parsing library, that supports Rust language bindings and has an available parser Rust tree-sitter-rust.
-
Plugins to help writing a new tree-sitter parser?
You can see a much more in-depth version at https://github.com/tree-sitter/tree-sitter-typescript or https://github.com/tree-sitter/tree-sitter-rust
-
Is rust-analyzer for neovim ever going to support semantic syntax highlighting?
I'll be really interested to see what folks end up preferring once nvim 0.5 ships with treesitter support. Do folks have any experience with the Rust grammar?
tree-sitter-c
- How to Get Started with Tree-Sitter
- Emacs and Java Development: Corfu + Cape + LSP-Mode + Treesit
-
GitHub code search is generally available
The feature isn't working well yet on C and C++. If I recall correctly it's based on Tree-Sitter[1] parsing, and there are still too many bugs in corresponding grammars - tree-sitter-c[2] and tree-sitter-cpp[3]. Hopefully, it will be greatly improved in the future as the share of the existing and newly written code in C and C++ is quite significant.
[1] https://tree-sitter.github.io/tree-sitter/
[2] https://github.com/tree-sitter/tree-sitter-c/issues
[3] https://github.com/tree-sitter/tree-sitter-cpp/issues
-
Indent 8 spaces
[[language]] name = "c" scope = "source.c" injection-regex = "c" file-types = ["c"] # TODO: ["h"] roots = [] comment-token = "//" language-server = { command = "clangd" } indent = { tab-width = 8, unit = " " } [language.debugger] name = "lldb-vscode" transport = "stdio" command = "lldb-vscode" [[language.debugger.templates]] name = "binary" request = "launch" completion = [ { name = "binary", completion = "filename" } ] args = { console = "internalConsole", program = "{0}" } [[language.debugger.templates]] name = "attach" request = "attach" completion = [ "pid" ] args = { console = "internalConsole", pid = "{0}" } [[language.debugger.templates]] name = "gdbserver attach" request = "attach" completion = [ { name = "lldb connect url", default = "connect://localhost:3333" }, { name = "file", completion = "filename" }, "pid" ] args = { console = "internalConsole", attachCommands = [ "platform select remote-gdb-server", "platform connect {0}", "file {1}", "attach {2}" ] } [[grammar]] name = "c" source = { git = "https://github.com/tree-sitter/tree-sitter-c", rev = "7175a6dd5fc1cee660dce6fe23f6043d75af424a" }
- Building tree-sitter languages for Emacs
-
treesitter printf format highlighting?
There's no way to highlight format specs currently, since the treesitter C grammar doesn't specify them. You could open an issue on the tree-sitter-c repo.
-
Tree-sitter: an incremental parsing system for programming tools
[1] https://github.com/tree-sitter/tree-sitter-c/issues/51
What are some alternatives?
coc.nvim - Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
csharp-mode - A major-mode for editing C# in emacs
rust-analyzer - A Rust compiler front-end for IDEs
tree-sitter-ruby - Ruby grammar for tree-sitter
tree-sitter-graphql - Treesitter grammar for GraphQL
tree-sitter-vue - Vue grammar for tree-sitter
nvim-treesitter - Nvim Treesitter configurations and abstraction layer
Moose - MOOSE - Platform for software and data analysis.
LanguageClient-neovim - Language Server Protocol (LSP) support for vim and neovim.
tree-sitter-cpp - C++ grammar for tree-sitter
rust-analyzer - A Rust compiler front-end for IDEs [Moved to: https://github.com/rust-lang/rust-analyzer]
tree-sitter-kotlin - Kotlin grammar for Tree-sitter