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

Method consider_decorator

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

Source from the content-addressed store, hash-verified

1064 }
1065
1066 fn consider_decorator(&mut self, n: Node<'t>, decorated_row: u32) {
1067 if !matches!(n.kind(), "decorator" | "annotation" | "marker_annotation" | "attribute") {
1068 return;
1069 }
1070 let mut target: Option<Node> = None;
1071 for i in 0..n.named_child_count() {
1072 let Some(child) = n.named_child(i) else { continue };
1073 if child.kind() == "call_expression" {
1074 target = child.child_by_field_name("function").or_else(|| child.named_child(0));
1075 if target.is_some() {
1076 break;
1077 }
1078 }
1079 if matches!(
1080 child.kind(),
1081 "identifier" | "member_expression" | "scoped_identifier" | "navigation_expression"
1082 | "user_type" | "type_identifier"
1083 ) {
1084 target = Some(child);
1085 break;
1086 }
1087 }
1088 let Some(target) = target else { return };
1089 let name = strip_generic_and_qualifier(self.text(target));
1090 if name.is_empty() {
1091 return;
1092 }
1093 self.push_ref_at(decorated_row, &name, edge_kind_index("decorates").unwrap(), n);
1094 }
1095
1096 /// extractTypeAnnotations — Java's returnField is `type`.
1097 fn extract_type_annotations(&mut self, node: Node<'t>, from_row: u32) {

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