MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / node_text

Function node_text

src/extraction/common.rs:14–18  ·  view source on GitHub ↗

Gets the text of a tree-sitter node from the source.

(source: &[u8], node: TsNode<'_>)

Source from the content-addressed store, hash-verified

12
13/// Gets the text of a tree-sitter node from the source.
14fn node_text(source: &[u8], node: TsNode<'_>) -> String {
15 node.utf8_text(source)
16 .unwrap_or("<invalid utf8>")
17 .to_string()
18}
19
20/// Strip comment markers from a single C-style comment text
21/// (`//` line comments and `/* ... */` block comments).

Callers 5

node_textMethod · 0.85
node_textMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected