Skip to content

CodeLens reference count is broken with references from generated code #76608

@Sergio0694

Description

@Sergio0694

Version Used: 4.12.0-3.24572.7 (dfa7fc6)

Steps to Reproduce:

  1. Use a source generator that produces any partial methods that you can implement, for instance the MVVM Toolkit
  2. Implement any of those generated partial methods (which are also invoked by the generated code)
  3. Observe that the reference count in CodeLens is != 0 (and the method is indeed not grayed out)
  4. Click on the reference count
  5. A flyout will show up and load
  6. The flyout will just fail to show any results
  7. After this, the reference count will be 0 (?!), however the method will (correctly) remain not grayed out
  8. Try to do right click > find all references on the method
  9. This will show the references correctly (however it'll show a mismatch with the original CodeLens count, eg. it'll say 1 but CodeLens said 2)

Expected Behavior:

  • The reference count shoud be consistent and always work
  • The CodeLens references flyout should work correctly

Actual Behavior:

Step 3:

Image

Step 5:

Image

Step 7 and 9:

Image

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions