Skip to content

Commit

Permalink
Release v1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
semihokur committed Jan 22, 2021
1 parent fb54e8b commit c4ffd7f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
50 changes: 50 additions & 0 deletions AsyncFixer.Test/UnnecessaryAsyncTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,56 @@ int streamOperation()
VerifyCSharpDiagnostic(test);
}

[Fact]
public void UsingStatementWithDataflow2()
{
var test = @"
using System;
using System.Threading.Tasks;
class Program
{
async Task foo()
{
using var stream = new MemoryStream();
int streamOperation()
{
var stream2 = new MemoryStream();
return stream2.Read(null);
}
stream.Read(null);
var t = Task.Run(() => streamOperation());
await t;
}
}";
var expected = new DiagnosticResult { Id = DiagnosticIds.UnnecessaryAsync };
VerifyCSharpDiagnostic(test, expected);

var fixtest = @"
using System;
using System.Threading.Tasks;
class Program
{
Task foo()
{
using var stream = new MemoryStream();
int streamOperation()
{
var stream2 = new MemoryStream();
return stream2.Read(null);
}
stream.Read(null);
var t = Task.Run(() => streamOperation());
return t;
}
}";

VerifyCSharpFix(test, fixtest);
}

[Fact(Skip = "TODO: fix the dataflow analysis to analyze all locations of the symbol, not only the definitions")]
public void NoWarn_UsingStatementWithDataflowComplicated()
{
Expand Down
2 changes: 1 addition & 1 deletion AsyncFixer.Vsix/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<Metadata>
<Identity Id="AsyncFixer.Vsix..edab5fce-e3aa-4fea-9d60-a07bc11d493b" Version="1.5.0" Language="en-US" Publisher="Semih Okur"/>
<Identity Id="AsyncFixer.Vsix..edab5fce-e3aa-4fea-9d60-a07bc11d493b" Version="1.5.1" Language="en-US" Publisher="Semih Okur"/>
<DisplayName>AsyncFixer for Visual Studio 2019</DisplayName>
<Description xml:space="preserve">Advanced async/await Diagnostics and CodeFixes for C#.</Description>
<MoreInfo>http://www.asyncfixer.com</MoreInfo>
Expand Down
2 changes: 1 addition & 1 deletion AsyncFixer/AsyncFixer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<PropertyGroup>
<PackageId>AsyncFixer</PackageId>
<PackageVersion>1.5.0</PackageVersion>
<PackageVersion>1.5.1</PackageVersion>
<Authors>Semih Okur</Authors>
<Title>AsyncFixer: Advanced async/await Diagnostics and CodeFixes for C#</Title>
<Description>
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release History

## 1.5.1 (2021-01)
- 01.UnnecessaryAsync: Implemented a dataflow analysis for disposable objects to fix false-negatives and false-positives

## 1.5.0 (2021-01)
- 01.UnnecessaryAsync: Fix false-negatives to cover more cases
- 02.BlockingCallInsideAsync: Stop suggesting async calls for virtual calls and Dispose methods
Expand Down

0 comments on commit c4ffd7f

Please sign in to comment.