コード例 #1
0
        private static Task Dispatch <T>(StreamJsonRpc.JsonRpc jsonRpc, TestContext?testContext, string message, T param)
        {
            if (testContext?.ForceSynchronousMessages == true)
            {
                // If we need to force messages to be synchronous, then we always
                // do 'invoke' instead of 'notify', and we always wait for the task
                // to finish
                jsonRpc.InvokeWithParameterObjectAsync <object>(message, param).GetAwaiter().GetResult();

                // Return a 'do nothing' task in this case
                return(Task.FromResult(0));
            }

            return(jsonRpc.NotifyWithParameterObjectAsync(message, param));
        }
コード例 #2
0
 /// <inheritdoc />
 public void WriteLine(EventLevel level, string message)
 {
     m_pushRpc
     .NotifyWithParameterObjectAsync(TraceTargetName, LogMessageParams.Create(level, message))
     .IgnoreErrorsAndReturnCompletion();
 }
コード例 #3
0
 /// <inheritdoc />
 public void ReportFindReferencesProgress(FindReferenceProgressParams findReferenceProgress)
 {
     Analysis.IgnoreResult(m_mainRpcChannel?.NotifyWithParameterObjectAsync("dscript/findReferenceProgress", findReferenceProgress), "Fire and forget");
 }
コード例 #4
0
 /// <inheritdoc />
 public void ReportWorkspaceFailure(string logFileName, Action openLogFileAction)
 {
     Analysis.IgnoreResult(m_mainRpcChannel.NotifyWithParameterObjectAsync("dscript/workspaceLoading", WorkspaceLoadingParams.Fail()), "Fire and forget");
 }