Expand description
Tree-sitter parsing and source-span collection.
Structs§
- Span
Record - Represents
SpanRecord.
Enums§
- TsGrammar
- Represents
TsGrammar.
Functions§
- collect_
spans - Parses C# source and returns its namespace, type, and member declaration spans.
- is_
ts_ js - Whether
relis a TS/JS file –ts_grammar_for(rel).is_some(). - node_
text - Text of
nodeout of autf16_bytesbuffer – the UTF-16 counterpart ofNode::utf8_text, and the only way to read source text in this crate. - parse_
ts_ js - One parse of
sourceundergrammar.Parser::parsereturnsNoneonly on cancellation/malformed-input-size edge cases, never on ordinary syntax errors (those surface as ERROR nodes inside a still-present tree). - run_
parse - Parses the C# file at
pathand prints its syntax tree. - run_
spans - Collects declaration spans from the C# file at
pathand prints them as JSON. - spans_
json - Serializes span records as a JSON array.
- ts_
grammar_ for - Maps a file extension to its grammar. Based on the last
.inrel, not path-aware: a dotted directory segment on a file with no extension of its own would misfire (a known, accepted edge case). - utf16_
bytes - The same units as a little-endian byte buffer, which is what node byte
offsets index into and therefore what every
text()helper slices. - utf16_
index - UTF-16 code-unit index for a byte offset (or column) reported by a tree
parsed out of a
utf16_bytesbuffer. - utf16_
units - Encodes source text as UTF-16 code units.