private static Func <object, Document, int, SignatureHelpTriggerInfoData, CancellationToken, Task> CompileGetItemsAsyncWithUntypedResult() { var instanceParameter = Expression.Parameter(typeof(object)); var documentParameter = Expression.Parameter(typeof(Document)); var positionParameter = Expression.Parameter(typeof(int)); var triggerInfoParameter = Expression.Parameter(typeof(SignatureHelpTriggerInfoData)); var cancellationTokenParameter = Expression.Parameter(typeof(CancellationToken)); var instanceTyped = instanceParameter.Convert(RoslynTypes.ISignatureHelpProvider.AsType()); var triggerInfo = SignatureHelpTriggerInfoData.ToInternalTypeExpressionSlow(triggerInfoParameter); var call = Expression.Call( instanceTyped, RoslynTypes.ISignatureHelpProvider.GetMethod("GetItemsAsync"), documentParameter, positionParameter, triggerInfo, cancellationTokenParameter ); return(Expression.Lambda <Func <object, Document, int, SignatureHelpTriggerInfoData, CancellationToken, Task> >( call, instanceParameter, documentParameter, positionParameter, triggerInfoParameter, cancellationTokenParameter ).Compile()); }
public async Task <SignatureHelpItemsData> GetItemsAsync(Document document, int position, SignatureHelpTriggerInfoData triggerInfo, CancellationToken cancellationToken) { var task = _getItemsAsyncWithUntypedResult(_provider, document, position, triggerInfo, cancellationToken); await task.ConfigureAwait(false); return(_convertGetItemsAsyncResult(task)); }