roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

IDE2001 codefix is offered but does nothing

Open Youssef1313 opened this issue 3 years ago • 1 comments

image

The scenario above is a switch statement with a trailing ; (the ; here is empty statement and should really be removed).

The codefix doesn't do anything. It should probably attempt to move the ; to its own line.

Repro: https://github.com/dotnet/roslyn-analyzers/blob/aef515f9955c81491bab8f3ac854915a92f2fc15/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs#L237-L251

Youssef1313 avatar Dec 14 '22 20:12 Youssef1313

I'm surprised this feature triggered here. it's not an embedded statement. So i'm not sure why the analyzer fired.

CyrusNajmabadi avatar Dec 14 '22 22:12 CyrusNajmabadi