| 4612 | } |
| 4613 | |
| 4614 | static void php_collect_external_uses(PHPLSPContext *ctx, const CBMPHPImportBindings *bindings) { |
| 4615 | if (!bindings || !bindings->targets || !bindings->imports) |
| 4616 | return; |
| 4617 | int count = bindings->imports->count; |
| 4618 | ctx->external_use_qns = |
| 4619 | cbm_arena_alloc(ctx->arena, (size_t)(count > 0 ? count : 1) * sizeof(char *)); |
| 4620 | if (!ctx->external_use_qns) |
| 4621 | return; |
| 4622 | for (int i = 0; i < count; i++) { |
| 4623 | const CBMImport *imp = &bindings->imports->items[i]; |
| 4624 | if (imp->kind == CBM_IMPORT_KIND_DEFAULT && !bindings->targets[i] && imp->local_name && |
| 4625 | imp->local_name[0] && imp->module_path && imp->module_path[0]) { |
| 4626 | const char *name = |
| 4627 | imp->module_path[0] == '\\' ? imp->module_path + 1 : imp->module_path; |
| 4628 | const char *qn = php_ns_to_dot(ctx->arena, name); |
| 4629 | if (qn) |
| 4630 | ctx->external_use_qns[ctx->external_use_count++] = qn; |
| 4631 | } |
| 4632 | } |
| 4633 | } |
| 4634 | |
| 4635 | void cbm_run_php_lsp_cross(CBMArena *arena, const char *source, int source_len, |
| 4636 | const char *module_qn, CBMLSPDef *defs, int def_count, |
no test coverage detected