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

Method consider_decorator

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

Source from the content-addressed store, hash-verified

1203 }
1204
1205 fn consider_decorator(&mut self, n: Node<'t>, decorated_row: u32) {
1206 if !matches!(n.kind(), "decorator" | "annotation" | "marker_annotation" | "attribute") {
1207 return;
1208 }
1209 let mut target: Option<Node> = None;
1210 for i in 0..n.named_child_count() {
1211 let Some(child) = n.named_child(i) else { continue };
1212 if child.kind() == "call_expression" {
1213 target = child.child_by_field_name("function").or_else(|| child.named_child(0));
1214 if target.is_some() {
1215 break;
1216 }
1217 }
1218 if matches!(
1219 child.kind(),
1220 "identifier" | "member_expression" | "scoped_identifier" | "navigation_expression"
1221 | "user_type" | "type_identifier"
1222 ) {
1223 target = Some(child);
1224 break;
1225 }
1226 }
1227 let Some(target) = target else { return };
1228 let name = strip_generic_and_qualifier(self.text(target));
1229 if name.is_empty() {
1230 return;
1231 }
1232 self.push_ref_at(decorated_row, &name, edge_kind_index("decorates").unwrap(), n);
1233 }
1234
1235 // --- function-as-value refs (KOTLIN_SPEC, function-ref.ts:240) ------------------
1236

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