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

Function addWrapperResultImports

java/scripts/codegen/java.ts:1631–1651  ·  view source on GitHub ↗
(resultType: string, allImports: Set<string>, packageName: string)

Source from the content-addressed store, hash-verified

1629}
1630
1631function addWrapperResultImports(resultType: string, allImports: Set<string>, packageName: string): void {
1632 if (resultType === "Void") {
1633 return;
1634 }
1635
1636 if (resultType === "JsonNode") {
1637 allImports.add("com.fasterxml.jackson.databind.JsonNode");
1638 return;
1639 }
1640
1641 if (resultType.startsWith("List<")) {
1642 allImports.add("java.util.List");
1643 }
1644
1645 const builtInTypes = new Set(["Boolean", "Double", "Long", "List", "Object", "String", "Void"]);
1646 for (const typeName of resultType.match(/\b[A-Z][A-Za-z0-9_]*\b/g) ?? []) {
1647 if (!builtInTypes.has(typeName)) {
1648 allImports.add(`${packageName}.${typeName}`);
1649 }
1650 }
1651}
1652
1653/**
1654 * Return the params class name if the method has a params schema with properties

Callers 2

generateNamespaceApiFileFunction · 0.85
generateRpcRootFileFunction · 0.85

Calls 1

addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…