MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / class_super_qn

Function class_super_qn

internal/cbm/lsp/java_lsp.c:1614–1633  ·  view source on GitHub ↗

Determine the class's super QN from the AST node. */

Source from the content-addressed store, hash-verified

1612
1613/* Determine the class's super QN from the AST node. */
1614static const char *class_super_qn(JavaLSPContext *ctx, TSNode class_node) {
1615 TSNode super_node = ts_node_child_by_field_name(class_node, "superclass", 10);
1616 if (ts_node_is_null(super_node))
1617 return NULL;
1618 /* superclass node has shape `extends T`; T is the named child. */
1619 TSNode tnode = (TSNode){0};
1620 if (ts_node_named_child_count(super_node) > 0) {
1621 tnode = ts_node_named_child(super_node, 0);
1622 } else {
1623 tnode = super_node;
1624 }
1625 if (ts_node_is_null(tnode))
1626 return NULL;
1627 const CBMType *t = java_parse_type_node(ctx, tnode);
1628 if (t && t->kind == CBM_TYPE_NAMED)
1629 return t->data.named.qualified_name;
1630 if (t && t->kind == CBM_TYPE_TEMPLATE)
1631 return t->data.template_type.template_name;
1632 return NULL;
1633}
1634
1635/* Java enum constants are direct enum_body children, while declarations after
1636 * the semicolon live in enum_body_declarations. LSP class processing only

Callers 1

java_process_class_declFunction · 0.85

Calls 1

java_parse_type_nodeFunction · 0.85

Tested by

no test coverage detected