dotnet / dotnet/roslyn

'Go to implementation' doesn't work with source-generated methods

Open
#82,891 1 comment 0 reactions 0 assignees View on GitHub
Area-IDE Feature - Source Generators Go To Implementation
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

**Version Used**:
VS 2026 Insiders [11612.153]

**Steps to Reproduce**:
```cs
using System.Text.RegularExpressions;

var wordRegex = Regexes.Word(); // 1

public partial class Regexes
{
[GeneratedRegex(@"\w")]
public static partial Regex Word(); // 2
}
```
Try to 'Go to implementation' of `Word` method at both `// 1` and `// 2`

**Expected behavior:**
I am navigated to the source-generated implementation of `Word`

**Actual behavior:**
Nothing happens.

**Additional info:**
Executing 'Go to definition' at `// 2` navigates to the source-generated implementation. This is a bug on its own not related to source-generators and is logged as https://github.com/dotnet/roslyn/issues/82889. The point is that 'Go to definition' is able to resolve the source-generated location, while 'Go to definition' struggles with the same task

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the C# snippet, focusing on 'Go to implementation' at both marked call sites and comparing it with 'Go to definition' at `// 2`. Trace the navigation path for the source-generated `Word` implementation and verify that the command navigates to the generated source at both locations.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.