microsoft / Microsoft.Unity.Analyzers

Roslyn analyzers for Unity game developers
MIT License
672 stars 71 forks source link

FixAll of UNT0021 doesn't work #308

Closed nyroro closed 8 months ago

nyroro commented 8 months ago

Bug description

FixAll of UNT0021 doesn't work

To Reproduce

Steps or code to reproduce the behavior:

  1. Go to code with private void Awake() and private void OnEnable()
  2. Click on FixAll and select Document QQ截图20240107193904

图片

  1. Only fix the one that click with. The other one is not fixed QQ截图20240107193919

Expected behavior

Expecte to fix the 2 UNT0021 in the same document.

sailro commented 8 months ago

Hello and thank you for this report. I'm currently investigating.

I also found a related bug with this analyzer when using messages with comments and without scope modifiers, so fixing this as well.

sailro commented 8 months ago

I found and fixed the root issue. Thanks!