MCPcopy Index your code
hub / github.com/github/copilot-sdk / resolvedResultTypeName

Function resolvedResultTypeName

scripts/codegen/csharp.ts:1460–1474  ·  view source on GitHub ↗

Returns the C# type for a method's result, accounting for nullable anyOf wrappers and opaque JSON.

(method: RpcMethod)

Source from the content-addressed store, hash-verified

1458
1459/** Returns the C# type for a method's result, accounting for nullable anyOf wrappers and opaque JSON. */
1460function resolvedResultTypeName(method: RpcMethod): string {
1461 const schema = getMethodResultSchema(method);
1462 if (!schema) return resultTypeName(method);
1463 if (isOpaqueJson(schema)) return "object";
1464 const inner = getNullableInner(schema);
1465 if (inner) {
1466 if (isOpaqueJson(inner)) return "object?";
1467 // Nullable wrapper: resolve the inner $ref type name with "?" suffix
1468 const innerName = inner.$ref
1469 ? typeToClassName(refTypeName(inner.$ref, rpcDefinitions))
1470 : getRpcSchemaTypeName(inner, resultTypeName(method));
1471 return `${innerName}?`;
1472 }
1473 return resultTypeName(method);
1474}
1475
1476/** Returns the ValueTask<T> or ValueTask string for an incoming-handler's result type. */
1477function handlerTaskType(method: RpcMethod): string {

Callers 2

handlerTaskTypeFunction · 0.85
resultTaskTypeFunction · 0.85

Calls 7

isOpaqueJsonFunction · 0.85
getNullableInnerFunction · 0.85
typeToClassNameFunction · 0.85
refTypeNameFunction · 0.85
getRpcSchemaTypeNameFunction · 0.85
getMethodResultSchemaFunction · 0.70
resultTypeNameFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…