dotnet / dotnet/roslyn

Find all references on aliases for non-named types does not work

Open
#82,175 1 comment 0 reactions 0 assignees View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

## Version Used
VS Community Version 18.2.1
Roslyn 5.0.0-2.26054.2 @ ec501e4c6f2689c9c71e38ce72d892675965c392

## Steps to Reproduce

Given the following code:
```cs
using unsafe MethodPtr = delegate*;
using IntegerArray = int[];
using unsafe Ptr = int*;

public static class C
{
public static void Usage()
{
IntegerArray v = [];
Ptr p = null;
MethodPtr ptr = null;
}
}
```

Place the cursor on any occurrence of the alias name (MethodPtr, IntegerArray or Ptr). Invoke Find all References (Shift+F12)

## Expected Result

The references are correctly found

## Actual Result

No results were found -- although the symbols are correctly sought for (the message is **not** 'Find All References' not invoked on applicable symbol)

## Notes

Go to declaration (F12) correctly works on all 3 aliases

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the supplied C# code with VS Community 18.2.1, invoking Find All References with Shift+F12 on MethodPtr, IntegerArray, and Ptr. Compare the reference-search behavior with the working Go to declaration behavior; done means references are returned for all three aliases.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
developer-experience, search, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.