MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / consider_decorator

Method consider_decorator

codegraph-kernel/src/kotlin.rs:1554–1582  ·  view source on GitHub ↗
(&mut self, n: Node<'t>, decorated_row: u32)

Source from the content-addressed store, hash-verified

1552 }
1553
1554 fn consider_decorator(&mut self, n: Node<'t>, decorated_row: u32) {
1555 if !matches!(n.kind(), "decorator" | "annotation" | "marker_annotation" | "attribute") {
1556 return;
1557 }
1558 let mut target: Option<Node> = None;
1559 for i in 0..n.named_child_count() {
1560 let Some(child) = n.named_child(i) else { continue };
1561 if child.kind() == "call_expression" {
1562 target = child.child_by_field_name("function").or_else(|| child.named_child(0));
1563 if target.is_some() {
1564 break;
1565 }
1566 }
1567 if matches!(
1568 child.kind(),
1569 "identifier" | "member_expression" | "scoped_identifier" | "navigation_expression"
1570 | "user_type" | "type_identifier"
1571 ) {
1572 target = Some(child);
1573 break;
1574 }
1575 }
1576 let Some(target) = target else { return };
1577 let name = strip_generic_and_qualifier(self.text(target));
1578 if name.is_empty() {
1579 return;
1580 }
1581 self.push_ref_at(decorated_row, &name, edge_kind_index("decorates").unwrap(), n);
1582 }
1583
1584 // --- function-as-value refs (KOTLIN_SPEC, function-ref.ts:240) ------------------
1585

Callers 1

Calls 5

edge_kind_indexFunction · 0.85
textMethod · 0.65
unwrapMethod · 0.60
push_ref_atMethod · 0.45

Tested by

no test coverage detected