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

Function owner

atomic-semantic/src/source.rs:193–208  ·  view source on GitHub ↗
(node: Node<'_>, source: &str)

Source from the content-addressed store, hash-verified

191}
192
193fn owner(node: Node<'_>, source: &str) -> Option<String> {
194 match node.kind() {
195 "impl_item" => node
196 .child_by_field_name("type")
197 .map(|node| nominal(text(node, source))),
198 "class_declaration"
199 | "class_definition"
200 | "class_specifier"
201 | "struct_specifier"
202 | "trait_item"
203 | "interface_declaration" => node
204 .child_by_field_name("name")
205 .map(|node| text(node, source).into()),
206 _ => None,
207 }
208}
209
210fn nominal(value: &str) -> String {
211 value

Callers 1

scopeFunction · 0.70

Calls 3

nominalFunction · 0.85
textFunction · 0.70
kindMethod · 0.45

Tested by

no test coverage detected