Runs work as an operation.
The result and any rejection reach the caller untouched, exactly as for a command. Operation resources are disposed before the returned promise settles; cleanup failures are reported but do not replace that result.
What the work is, for diagnostics and log fields
The work
Optionaloptions: RunTaskOptions
Caller cancellation and deadline
Starts Operation-scoped framework work from somewhere that is not a command.
A command handler is handed an OperationContext — cancellation, a scoped logger, a resource scope,
progress. Plenty of real work starts elsewhere: a webview asks the host to do something over RPC, a tree view refreshes, an editor event fires. This is how that work gets the same context, rather than each caller improvising a signal and a progress call.It is not a second way to show progress.
context.progressremains the only one; this is how you come by acontextoutside a handler.Example