| 1245 | } |
| 1246 | |
| 1247 | static bool is_string_concat(JavaLSPContext *ctx, TSNode node) { |
| 1248 | /* Either operand of type java.lang.String makes the whole expr a String. */ |
| 1249 | TSNode lhs = ts_node_child_by_field_name(node, "left", 4); |
| 1250 | TSNode rhs = ts_node_child_by_field_name(node, "right", 5); |
| 1251 | const CBMType *l = java_eval_expr_type(ctx, lhs); |
| 1252 | const CBMType *r = java_eval_expr_type(ctx, rhs); |
| 1253 | if (l && l->kind == CBM_TYPE_NAMED && |
| 1254 | strcmp(l->data.named.qualified_name, "java.lang.String") == 0) |
| 1255 | return true; |
| 1256 | if (r && r->kind == CBM_TYPE_NAMED && |
| 1257 | strcmp(r->data.named.qualified_name, "java.lang.String") == 0) |
| 1258 | return true; |
| 1259 | return false; |
| 1260 | } |
| 1261 | |
| 1262 | static const CBMType *eval_binary(JavaLSPContext *ctx, TSNode node) { |
| 1263 | /* Determine operator. tree-sitter-java exposes it as a child token. */ |
no test coverage detected