DisposableFixer icon indicating copy to clipboard operation
DisposableFixer copied to clipboard

Add support for IAsyncDisposable

Open TwentyFourMinutes opened this issue 5 years ago • 2 comments

Prerequisites

Version: 3.3.0

Description

If I dispose a MemoryStream with DisposeAsync the Analyzer still yells at me DF0010. I really searched the whole repo, but couldn't find anything regarding to async disposal.

Source Code

var memoryStream = new MemoryStream();

await memoryStream.DisposeAsync();

TwentyFourMinutes avatar Apr 01 '20 01:04 TwentyFourMinutes

Hello, First of all, thank you for reporting. You are right, there is no support for IAsyncDisposable yet. Neither when recognizing nor with CodeFix. Unfortunately, I am currently working on a project that uses VS2017 and .Net 4.5.2. So I don't stumble upon these shortcomings myself and am dependent on other people who do this.

Basically, it shouldn't be a big deal to do this, but thanks to the current pandemia, I don't have the time. So it can take some time for me to fix the problem.

BADF00D avatar Apr 02 '20 18:04 BADF00D

Sure thing, just wanted to note it and get some reports on it. Thanks for letting me know though.

TwentyFourMinutes avatar Apr 02 '20 20:04 TwentyFourMinutes