Skip to content

Reference highlighting doesn't work for some types from constructor expression #74803

@Peter-Juhasz

Description

@Peter-Juhasz

Version Used: 17.12.0 P1

Steps to Reproduce:

Look at how highlighting of references of FinishedStatus doesn't work if I select the symbol in a constructor expression, while it works if I select the type in a declaration expression:

Kepernyofelvetel.2024-08-19.175334.mp4
[JsonPolymorphic]
[JsonDerivedType(typeof(FinishedStatus), "Jobs.Finished")]
public abstract record class JobStatusUpdate(DateTimeOffset Timestamp);

public record class FinishedStatus(DateTimeOffset Timestamp) : JobStatusUpdate(Timestamp);

Unfortunately, I could not narrow down the context in which it doesn't work. But it never picks up this type (or any of its siblings - inherited from JobStatusUpdate) in any file in the whole solution.

Notes:

  • Code compiles successfully
  • Go To Definition and Find All References work fine

Diagnostic Id:
N/A

Expected Behavior:
It finds and highlights references from all starting points.

Actual Behavior:
It does not highlight references from a constructor expression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions