| Crates.io | tss-rust |
| lib.rs | tss-rust |
| version | 0.2.2 |
| created_at | 2025-11-03 13:31:41.233059+00 |
| updated_at | 2025-11-05 15:29:43.602312+00 |
| description | Generated node type enums and metadata from tree-sitter-rust |
| homepage | https://github.com/lmmx/tree-sitter-symbols |
| repository | https://github.com/lmmx/tss |
| max_upload_size | |
| id | 1914628 |
| size | 53,122 |
Generated node type enums and metadata from tree-sitter-rust.
[dependencies]
tss-rust = "0.1"
tree-sitter = "0.24"
tree-sitter-rust = "0.24"
use tree_sitter_symbols_rust::NodeType;
use std::str::FromStr;
let node_type = NodeType::from_str("function_item")?;
assert_eq!(node_type, NodeType::FunctionItem);
assert_eq!(node_type.to_string(), "function_item");
Default includes all metadata:
tss-rust = "0.1"
Select specific metadata:
tss-rust = { version = "0.1", default-features = false, features = ["meta_named", "meta_fields"] }
Available metadata features:
meta_named - whether nodes are named in the grammarmeta_subtypes - possible subtypes for each nodemeta_fields - named fields nodes can havemeta_children - anonymous children nodes can havemeta_extra - extra node markersmeta_root - root node markersAt build time, each language reads the corresponding tree-sitter-* language crate's NODE_TYPES constant and generates:
NodeType enum with all 280 node typesFromStr for parsing node type stringsDisplay for converting back to stringsThis allows a crate to ship this information as an enum type with zero runtime dependencies. All generation happens at compile time. This is useful for type safety (rather than checking for strings, as well as hopefully to demystify how tree-sitter languages work.
MIT licensed - see LICENSE for details.