Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Merge pull request #467 from isc-tdyar/pr/objectscript-language-support

Martin Vogelfeadbe1955dd
diff --cc internal/cbm/extract_calls.c
index 6f6505062,0c0b677b8..ea0fb8b94
--- a/internal/cbm/extract_calls.c
+++ b/internal/cbm/extract_calls.c
@@@ -2064,26 -2088,20 +2235,38 @@@ void handle_calls(CBMExtractCtx *ctx, T
}
TSNode args = ts_node_child_by_field_name(node, TS_FIELD("arguments"));
+ // ObjectScript stores args under oref_method/method_args, not the
+ // generic "arguments" field.
+ if (ts_node_is_null(args) && (ctx->language == CBM_LANG_OBJECTSCRIPT_UDL ||
+ ctx->language == CBM_LANG_OBJECTSCRIPT_ROUTINE)) {
+ TSNode oref = cbm_find_child_by_kind(node, "oref_method");
+ if (!ts_node_is_null(oref)) {
+ args = cbm_find_child_by_kind(oref, "method_args");
+ }
+ if (ts_node_is_null(args)) {
+ args = cbm_find_child_by_kind(node, "method_args");
+ }
+ }
if (!ts_node_is_null(args)) {
call.first_string_arg = extract_url_or_topic_arg(ctx, args);
+ /* #952: routes registered inside Laravel `prefix()->group()`
+ * closures must carry the composed path — the resolve passes
+ * only see the flat CBMCall, so the enclosing chain can only
+ * be read here where the AST still exists. */
+ if (ctx->language == CBM_LANG_PHP && call.first_string_arg &&
+ call.first_string_arg[0] == '/' && call.callee_name &&
+ cbm_service_pattern_route_method(call.callee_name) != NULL) {
+ const char *gp = php_group_prefix_for_call(ctx->arena, node, ctx->source);
+ if (gp && gp[0]) {
+ const char *rel = call.first_string_arg;
+ while (*rel == '/') {
+ rel++;
+ }
+ call.first_string_arg =
+ rel[0] ? cbm_arena_sprintf(ctx->arena, "%s/%s", gp, rel)
+ : cbm_arena_strndup(ctx->arena, gp, strlen(gp));
+ }
+ }
if (call.first_string_arg && call.first_string_arg[0] == '/') {
call.second_arg_name = extract_handler_arg(ctx, args);
}