Custom pattern exclusion
I'm trying to create a custom pattern for highlighting disposable objects without the using keyword, more specifically on the form of
$disp$ $var$ = $exp$;where disp is of type System.IDisposable, example
var result = httpClient.PostAsync(...);It works fine at finding them, but I haven't been able to make it so that it excludes the ones that already have using in front of them, that is
using var result = httpClient.PostAsync(...);should not get targetted.
Is there a way to exclude the ones that already have the using keyword?
Please sign in to leave a comment.
Hello,
thank you for contacting us.
Unfortunately, this is not possible at this moment.
We have a feature request about it, you are welcome to comment on it and vote.
Thank you!