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

Method consider_decorator

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

Source from the content-addressed store, hash-verified

1362 }
1363
1364 fn consider_decorator(&mut self, n: Node<'t>, decorated_row: u32) {
1365 if !matches!(n.kind(), "decorator" | "annotation" | "marker_annotation" | "attribute") {
1366 return;
1367 }
1368 let mut target: Option<Node> = None;
1369 for i in 0..n.named_child_count() {
1370 let Some(child) = n.named_child(i) else { continue };
1371 if child.kind() == "call_expression" {
1372 target = child.child_by_field_name("function").or_else(|| child.named_child(0));
1373 if target.is_some() {
1374 break;
1375 }
1376 }
1377 if matches!(
1378 child.kind(),
1379 "identifier" | "member_expression" | "scoped_identifier" | "navigation_expression"
1380 | "user_type" | "type_identifier"
1381 ) {
1382 target = Some(child);
1383 break;
1384 }
1385 }
1386 let Some(target) = target else { return };
1387 let name = strip_generic_and_qualifier(self.text(target));
1388 if name.is_empty() {
1389 return;
1390 }
1391 self.push_ref_at(decorated_row, &name, edge_kind_index("decorates").unwrap(), n);
1392 }
1393
1394 // --- function-as-value refs (KOTLIN_SPEC, function-ref.ts:240) ------------------
1395

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