Skip to content

Commit c4ffd7f

Browse files
committed
Release v1.5.1
1 parent fb54e8b commit c4ffd7f

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

AsyncFixer.Test/UnnecessaryAsyncTests.cs

+50
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,56 @@ int streamOperation()
663663
VerifyCSharpDiagnostic(test);
664664
}
665665

666+
[Fact]
667+
public void UsingStatementWithDataflow2()
668+
{
669+
var test = @"
670+
using System;
671+
using System.Threading.Tasks;
672+
673+
class Program
674+
{
675+
async Task foo()
676+
{
677+
using var stream = new MemoryStream();
678+
int streamOperation()
679+
{
680+
var stream2 = new MemoryStream();
681+
return stream2.Read(null);
682+
}
683+
684+
stream.Read(null);
685+
var t = Task.Run(() => streamOperation());
686+
await t;
687+
}
688+
}";
689+
var expected = new DiagnosticResult { Id = DiagnosticIds.UnnecessaryAsync };
690+
VerifyCSharpDiagnostic(test, expected);
691+
692+
var fixtest = @"
693+
using System;
694+
using System.Threading.Tasks;
695+
696+
class Program
697+
{
698+
Task foo()
699+
{
700+
using var stream = new MemoryStream();
701+
int streamOperation()
702+
{
703+
var stream2 = new MemoryStream();
704+
return stream2.Read(null);
705+
}
706+
707+
stream.Read(null);
708+
var t = Task.Run(() => streamOperation());
709+
return t;
710+
}
711+
}";
712+
713+
VerifyCSharpFix(test, fixtest);
714+
}
715+
666716
[Fact(Skip = "TODO: fix the dataflow analysis to analyze all locations of the symbol, not only the definitions")]
667717
public void NoWarn_UsingStatementWithDataflowComplicated()
668718
{

AsyncFixer.Vsix/source.extension.vsixmanifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="AsyncFixer.Vsix..edab5fce-e3aa-4fea-9d60-a07bc11d493b" Version="1.5.0" Language="en-US" Publisher="Semih Okur"/>
4+
<Identity Id="AsyncFixer.Vsix..edab5fce-e3aa-4fea-9d60-a07bc11d493b" Version="1.5.1" Language="en-US" Publisher="Semih Okur"/>
55
<DisplayName>AsyncFixer for Visual Studio 2019</DisplayName>
66
<Description xml:space="preserve">Advanced async/await Diagnostics and CodeFixes for C#.</Description>
77
<MoreInfo>http://www.asyncfixer.com</MoreInfo>

AsyncFixer/AsyncFixer.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<PropertyGroup>
1111
<PackageId>AsyncFixer</PackageId>
12-
<PackageVersion>1.5.0</PackageVersion>
12+
<PackageVersion>1.5.1</PackageVersion>
1313
<Authors>Semih Okur</Authors>
1414
<Title>AsyncFixer: Advanced async/await Diagnostics and CodeFixes for C#</Title>
1515
<Description>

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release History
22

3+
## 1.5.1 (2021-01)
4+
- 01.UnnecessaryAsync: Implemented a dataflow analysis for disposable objects to fix false-negatives and false-positives
5+
36
## 1.5.0 (2021-01)
47
- 01.UnnecessaryAsync: Fix false-negatives to cover more cases
58
- 02.BlockingCallInsideAsync: Stop suggesting async calls for virtual calls and Dispose methods

0 commit comments

Comments
 (0)