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

Function eval_object_creation

internal/cbm/lsp/java_lsp.c:1199–1216  ·  view source on GitHub ↗

`new Foo ()` */

Source from the content-addressed store, hash-verified

1197
1198/* `new Foo<T>()` */
1199static const CBMType *eval_object_creation(JavaLSPContext *ctx, TSNode node) {
1200 TSNode type_node = ts_node_child_by_field_name(node, "type", 4);
1201 if (ts_node_is_null(type_node)) {
1202 /* Could be qualified expression form. */
1203 for (uint32_t i = 0; i < ts_node_named_child_count(node); i++) {
1204 TSNode c = ts_node_named_child(node, i);
1205 const char *k = ts_node_type(c);
1206 if (strcmp(k, "type_identifier") == 0 || strcmp(k, "scoped_type_identifier") == 0 ||
1207 strcmp(k, "generic_type") == 0) {
1208 type_node = c;
1209 break;
1210 }
1211 }
1212 }
1213 if (ts_node_is_null(type_node))
1214 return cbm_type_unknown();
1215 return java_parse_type_node(ctx, type_node);
1216}
1217
1218static const CBMType *eval_array_access(JavaLSPContext *ctx, TSNode node) {
1219 TSNode arr = ts_node_child_by_field_name(node, "array", 5);

Callers 1

java_eval_expr_typeFunction · 0.85

Calls 2

cbm_type_unknownFunction · 0.85
java_parse_type_nodeFunction · 0.85

Tested by

no test coverage detected