`new Foo ()` */
| 1197 | |
| 1198 | /* `new Foo<T>()` */ |
| 1199 | static 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 | |
| 1218 | static const CBMType *eval_array_access(JavaLSPContext *ctx, TSNode node) { |
| 1219 | TSNode arr = ts_node_child_by_field_name(node, "array", 5); |
no test coverage detected