Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading completion for cref in inheritdoc #76579

Open
Youssef1313 opened this issue Dec 29, 2024 · 0 comments
Open

Misleading completion for cref in inheritdoc #76579

Youssef1313 opened this issue Dec 29, 2024 · 0 comments
Labels
Area-IDE Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone

Comments

@Youssef1313
Copy link
Member

Version Used: VS 17.13 Preview 1

Steps to Reproduce:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net9.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <GenerateDocumentationFile>true</GenerateDocumentationFile> <!-- important for repro -->
  </PropertyGroup>

</Project>
Console.WriteLine();

public class C
{
    /// <summary>Whatever</summary>
    public static void M1<T>(T? expected)
    {
    }

    /// <inheritdoc cref="M1$$" />
    public static void M2()
    {
    }
}

Trigger completion in place of $$, it completes to M1{T}(T?) which produces:

CS1574 XML comment has cref attribute 'M1{T}(T?)' that could not be resolved

It should have completed to M1{T}(T) (unless the completion is correct and this is a compiler bug?)

NOTE: Some scenarios that are working currently correctly but need to be taken with care to not regress them

If you have:

/// <summary>Whatever</summary>
public static void M1<T>(T? expected) where T : struct
{
}

/// <summary>Whatever 2</summary>
public static void M1<T>(T expected) where T : struct
{
}

Then completion for both T and T? should be offered (and is currently the case that should not be regressed).

Similarly, even if only this overload exists:

/// <summary>Whatever</summary>
public static void M1<T>(T? expected) where T : struct
{
}

The completion should use T?

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 29, 2024
@CyrusNajmabadi CyrusNajmabadi added Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it Area-IDE and removed Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 29, 2024
@CyrusNajmabadi CyrusNajmabadi added this to the Backlog milestone Dec 29, 2024
@github-project-automation github-project-automation bot moved this to InQueue in Small Fixes Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
Status: InQueue
Development

No branches or pull requests

2 participants