[workbench] Improve asynchronous tool use (#30184)

GitOrigin-RevId: d1bd33469b557c29968049af99b9c3c85731151d
This commit is contained in:
Alf Eaton
2025-12-10 09:06:43 +00:00
committed by Copybot
parent 851f0c92b1
commit b811da0695
13 changed files with 40 additions and 25 deletions
@@ -120,7 +120,7 @@ export type CompileContext = {
setAnimateCompileDropdownArrow: (value: boolean) => void
recompileFromScratch: () => void
setCompiling: (value: boolean) => void
startCompile: (options?: any) => void
startCompile: (options?: any) => Promise<void>
stopCompile: () => void
setChangedAt: (value: any) => void
clearCache: () => void
@@ -700,14 +700,14 @@ export const LocalCompileProvider: FC<React.PropsWithChildren> = ({
const startCompile = useCallback(
(options: any) => {
setCompiledOnce(true)
compiler.compile(options)
return compiler.compile(options)
},
[compiler, setCompiledOnce]
)
// stop a compile manually
const stopCompile = useCallback(() => {
compiler.stopCompile()
return compiler.stopCompile()
}, [compiler])
// clear the compile cache