MCPcopy Create free account
hub / github.com/douglance/devsql / extract_name

Function extract_name

crates/devsql/src/providers/symbols.rs:270–280  ·  view source on GitHub ↗
(node: Node, source: &str)

Source from the content-addressed store, hash-verified

268
269#[cfg(feature = "tree-sitter-ast")]
270fn extract_name(node: Node, source: &str) -> String {
271 if let Some(name_node) = node.child_by_field_name("name") {
272 return node_text(name_node, source);
273 }
274 if node.kind() == "impl_item" {
275 if let Some(target) = node.child_by_field_name("type") {
276 return node_text(target, source);
277 }
278 }
279 String::new()
280}
281
282#[cfg(feature = "tree-sitter-ast")]
283fn decorated_target(node: Node) -> Option<Node> {

Callers 1

Calls 1

node_textFunction · 0.70

Tested by

no test coverage detected