Skip to content

Commit

Permalink
Merge pull request #437 from AArnott/updateDeps
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
AArnott authored Mar 30, 2020
2 parents 43712b6 + 517ba73 commit a6accf1
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 14 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ dlldata.c
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
Expand Down
16 changes: 16 additions & 0 deletions Directory.Build.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#------------------------------------------------------------------------------
# This file contains command-line options that MSBuild will process as part of
# every build, unless the "/noautoresponse" switch is specified.
#
# MSBuild processes the options in this file first, before processing the
# options on the command line. As a result, options on the command line can
# override the options in this file. However, depending on the options being
# set, the overriding can also result in conflicts.
#
# NOTE: The "/noautoresponse" switch cannot be specified in this file, nor in
# any response file that is referenced by this file.
#------------------------------------------------------------------------------
/nr:false
/m
/verbosity:minimal
/clp:Summary;ForceNoAlign
6 changes: 3 additions & 3 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

<ItemGroup>
<PackageReference Include="MicroBuild.VisualStudio" Version="$(MicroBuildPackageVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.4.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.5.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.0.50" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.74" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)PackageIcon.png" Pack="true" PackagePath="" />
Expand Down
4 changes: 2 additions & 2 deletions src/StreamJsonRpc.Tests/JsonRpcProxyGenerationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -654,13 +654,13 @@ internal class Server : IServerDerived, IServer2, IServer3, IServerWithValueTask
public Task IncrementAsync()
{
this.Counter++;
return TplExtensions.CompletedTask;
return Task.CompletedTask;
}

public Task Dispose()
{
this.Counter--;
return TplExtensions.CompletedTask;
return Task.CompletedTask;
}

public async Task HeavyWorkAsync(CancellationToken cancellationToken)
Expand Down
2 changes: 1 addition & 1 deletion src/StreamJsonRpc.Tests/StreamJsonRpc.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Microsoft.VisualStudio.Validation" Version="15.5.31" />
<PackageReference Include="System.IO.Pipes" Version="4.3.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/StreamJsonRpc.Tests/WebSocketMessageHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private class MockWebSocket : WebSocket

public override void Abort() => throw new NotImplementedException();

public override Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) => TplExtensions.CompletedTask;
public override Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) => Task.CompletedTask;

public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) => throw new NotImplementedException();

Expand Down Expand Up @@ -335,7 +335,7 @@ public override Task SendAsync(ArraySegment<byte> input, WebSocketMessageType me
this.writingInProgress = null;
}

return TplExtensions.CompletedTask;
return Task.CompletedTask;
}

internal void EnqueueRead(byte[] buffer)
Expand Down
6 changes: 4 additions & 2 deletions src/StreamJsonRpc/HeaderDelimitedMessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ protected override void Write(JsonRpcMessage content, CancellationToken cancella
unsafe int WriteHeaderText(string value, Span<byte> memory)
{
fixed (char* pValue = &MemoryMarshal.GetReference(value.AsSpan()))
fixed (byte* pMemory = &MemoryMarshal.GetReference(memory))
{
return HeaderEncoding.GetBytes(pValue, value.Length, pMemory, memory.Length);
fixed (byte* pMemory = &MemoryMarshal.GetReference(memory))
{
return HeaderEncoding.GetBytes(pValue, value.Length, pMemory, memory.Length);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/StreamJsonRpc/JsonMessageFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,9 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
throw new NotSupportedException();
}

#pragma warning disable VSTHRD200 // Use "Async" suffix in names of methods that return an awaitable type.
private IAsyncEnumerable<T> ReadJson<T>(JsonReader reader, JsonSerializer serializer)
#pragma warning restore VSTHRD200 // Use "Async" suffix in names of methods that return an awaitable type.
{
JToken enumJToken = JToken.Load(reader);
JToken handle = enumJToken[MessageFormatterEnumerableTracker.TokenPropertyName];
Expand Down
2 changes: 2 additions & 0 deletions src/StreamJsonRpc/JsonRpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,9 @@ private static bool TryGetTaskOfTOrValueTaskOfTType(TypeInfo taskTypeInfo, [NotN
taskOfTTypeInfo = null;
return false;

#pragma warning disable CS8762 // https://github.com/dotnet/roslyn/issues/41673
bool IsTaskOfTOrValueTaskOfT(TypeInfo typeInfo) => typeInfo.IsGenericType && (typeInfo.GetGenericTypeDefinition() == typeof(Task<>) || typeInfo.GetGenericTypeDefinition() == typeof(ValueTask<>));
#pragma warning restore CS8762 // https://github.com/dotnet/roslyn/issues/41673
}

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/StreamJsonRpc/JsonRpcExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace StreamJsonRpc
/// </summary>
public static class JsonRpcExtensions
{
#pragma warning disable VSTHRD200 // Use "Async" suffix in names of methods that return an awaitable type.
/// <summary>
/// Decorates an <see cref="IAsyncEnumerable{T}"/> with settings that customize how StreamJsonRpc will send its items to the remote party.
/// </summary>
Expand Down Expand Up @@ -100,6 +101,7 @@ public static async ValueTask<IAsyncEnumerable<T>> WithPrefetchAsync<T>(this IAs
await rpcEnumerable.PrefetchAsync(count, cancellationToken).ConfigureAwait(false);
return rpcEnumerable;
}
#pragma warning restore VSTHRD200 // Use "Async" suffix in names of methods that return an awaitable type.

/// <summary>
/// Extracts the <see cref="JsonRpcEnumerableSettings"/> from an <see cref="IAsyncEnumerable{T}"/>
Expand Down
2 changes: 2 additions & 0 deletions src/StreamJsonRpc/Reflection/CodeGenHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ namespace StreamJsonRpc.Reflection
[Obsolete("This class is only for invoking from dynamically generated code.")]
public static class CodeGenHelpers
{
#pragma warning disable VSTHRD200 // Use "Async" suffix in names of methods that return an awaitable type.
/// <inheritdoc cref="ProxyGeneration.AsyncEnumerableProxy{T}"/>
public static IAsyncEnumerable<T> CreateAsyncEnumerableProxy<T>(Task<IAsyncEnumerable<T>> enumerableTask, CancellationToken defaultCancellationToken) => new ProxyGeneration.AsyncEnumerableProxy<T>(enumerableTask, defaultCancellationToken);
#pragma warning restore VSTHRD200 // Use "Async" suffix in names of methods that return an awaitable type.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ public long GetToken<T>(IAsyncEnumerable<T> enumerable)
/// <param name="handle">The handle specified by the generator that is used to obtain more values or dispose of the enumerator. May be <c>null</c> to indicate there will be no more values.</param>
/// <param name="prefetchedItems">The list of items that are included with the enumerable handle.</param>
/// <returns>The enumerator.</returns>
#pragma warning disable VSTHRD200 // Use "Async" suffix in names of methods that return an awaitable type.
public IAsyncEnumerable<T> CreateEnumerableProxy<T>(object? handle, IReadOnlyList<T>? prefetchedItems)
#pragma warning restore VSTHRD200 // Use "Async" suffix in names of methods that return an awaitable type.
{
return new AsyncEnumerableProxy<T>(this.jsonRpc, handle, prefetchedItems);
}
Expand Down
6 changes: 3 additions & 3 deletions src/StreamJsonRpc/StreamJsonRpc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
<PackageReference Include="MessagePack" Version="2.1.90" />
<PackageReference Include="MessagePackAnalyzer" Version="2.1.90" PrivateAssets="all" />
<!-- <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4" PrivateAssets="all" /> -->
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="16.4.45" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="16.4.45" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="16.5.132" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="16.5.132" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0" PrivateAssets="compile" />
<PackageReference Include="Nerdbank.Streams" Version="2.4.60" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Roslyn.Diagnostics.Analyzers" Version="2.9.7" PrivateAssets="all" />
<PackageReference Include="System.Collections.Immutable" Version="1.5.0" />
<PackageReference Include="System.IO.Pipelines" Version="4.6.0" />
<PackageReference Include="System.IO.Pipelines" Version="4.7.0" />
<PackageReference Include="System.Memory" Version="4.5.3" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Net.WebSockets" Version="4.3.0" />
Expand Down

0 comments on commit a6accf1

Please sign in to comment.