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

Function cs_unwrap_task

internal/cbm/lsp/cs_lsp.c:681–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679/* ── expression evaluation ──────────────────────────────────────── */
680
681static const CBMType *cs_unwrap_task(CSLSPContext *ctx, const CBMType *t) {
682 (void)ctx;
683 if (!t) return cbm_type_unknown();
684 if (t->kind == CBM_TYPE_TEMPLATE) {
685 const char *n = t->data.template_type.template_name;
686 if (n && (strcmp(n, "System.Threading.Tasks.Task") == 0 ||
687 strcmp(n, "System.Threading.Tasks.ValueTask") == 0)) {
688 if (t->data.template_type.template_args && t->data.template_type.template_args[0]) {
689 return t->data.template_type.template_args[0];
690 }
691 }
692 }
693 if (t->kind == CBM_TYPE_NAMED) {
694 const char *qn = t->data.named.qualified_name;
695 if (qn && (strcmp(qn, "System.Threading.Tasks.Task") == 0 ||
696 strcmp(qn, "System.Threading.Tasks.ValueTask") == 0)) {
697 return cbm_type_unknown();
698 }
699 }
700 return t;
701}
702
703static const CBMType *cs_unwrap_nullable(const CBMType *t) {
704 if (!t) return t;

Callers 1

cs_eval_expr_typeFunction · 0.85

Calls 1

cbm_type_unknownFunction · 0.85

Tested by

no test coverage detected