fix(codemode): return promises from combinators (#35782)

This commit is contained in:
Aiden Cline 2026-07-10 00:33:21 -05:00 committed by GitHub
commit 39cceeb143
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 1794 additions and 479 deletions

View file

@ -169,9 +169,12 @@ function formatResult(result: CodeMode.Result) {
: [result.error.message, ...(result.error.suggestions ?? []).filter((hint) => !result.error.message.includes(hint))]
.join("\n")
.trim()
if (!result.logs || result.logs.length === 0) return output
const logs = `Logs:\n${result.logs.join("\n")}`
return output === "" ? logs : `${output}\n\n${logs}`
const warnings =
result.ok && result.warnings && result.warnings.length > 0
? `Warnings:\n${result.warnings.map((item) => `- [${item.kind}] ${item.message}`).join("\n")}`
: undefined
const logs = result.logs && result.logs.length > 0 ? `Logs:\n${result.logs.join("\n")}` : undefined
return [output, warnings, logs].filter((part) => part !== undefined && part !== "").join("\n\n")
}
function formatValue(value: CodeMode.DataValue) {