MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / first_line

Method first_line

atomic-semantic/src/parsers/rust.rs:500–504  ·  view source on GitHub ↗

Get the first line of a node's text (for signatures).

(&self, node: &Node, source: &str)

Source from the content-addressed store, hash-verified

498
499 /// Get the first line of a node's text (for signatures).
500 fn first_line(&self, node: &Node, source: &str) -> Option<String> {
501 let text = self.node_text(node, source);
502 let first = text.lines().next()?;
503 Some(first.trim_end_matches('{').trim().to_string())
504 }
505
506 /// Walk the AST collecting function call sites.
507 ///

Callers 4

extract_type_aliasMethod · 0.80
extract_constMethod · 0.80
extract_staticMethod · 0.80
build_impl_signatureMethod · 0.80

Calls 3

node_textMethod · 0.45
nextMethod · 0.45
linesMethod · 0.45

Tested by

no test coverage detected