IHostTaskExecutor.ExecuteTaskAsync<TOutput> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Executes a task in host environment if host task executor is available. This is critical to trust between LSP and its hosts. LSP should correctly use this and wrap particulat steps that need to run in host using these methods.
public System.Threading.Tasks.Task<TOutput> ExecuteTaskAsync<TOutput>(Func<System.Threading.Tasks.Task<TOutput>> task, Microsoft.PowerFx.LanguageServerProtocol.Handlers.LanguageServerOperationContext operationContext, System.Threading.CancellationToken cancellationToken, TOutput defaultOutput = default);
abstract member ExecuteTaskAsync : Func<System.Threading.Tasks.Task<'Output>> * Microsoft.PowerFx.LanguageServerProtocol.Handlers.LanguageServerOperationContext * System.Threading.CancellationToken * 'Output -> System.Threading.Tasks.Task<'Output>
Public Function ExecuteTaskAsync(Of TOutput) (task As Func(Of Task(Of TOutput)), operationContext As LanguageServerOperationContext, cancellationToken As CancellationToken, Optional defaultOutput As TOutput = Nothing) As Task(Of TOutput)
Type Parameters
- TOutput
Output Type.
Parameters
- operationContext
- LanguageServerOperationContext
Language Server Operation Context.
- cancellationToken
- CancellationToken
Cancellation Token.
- defaultOutput
- TOutput
Default Output to return if the provided task is canceled by host.
Returns
Output.