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

CS1591 CodeFix does not work correctly when there is anything but OpenBraceToken #61562

Closed
LukasGelke opened this issue May 27, 2022 · 2 comments · Fixed by #76024
Closed

CS1591 CodeFix does not work correctly when there is anything but OpenBraceToken #61562

LukasGelke opened this issue May 27, 2022 · 2 comments · Fixed by #76024
Assignees
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

@LukasGelke
Copy link

since #56620 was done here, I think this belongs here

Version Used:
VisualStudio (with a "clean rootsuffix"): 17.2.2
DotNet: 6.0.300
Steps to Reproduce:

  1. Create a new Solution/Project (eg ConsoleApp) with net6.0
  2. we use a 2 wide 'space' smart indent; if that matters
  3. in the csproj add/enable: <GenerateDocumentationFile>true</GenerateDocumentationFile>
  4. implement/overrride abstract member. Like This:
namespace Issue; 

/// <summary>
/// Hello C1
/// </summary>
public abstract class Class1
{
  /// <summary>
  /// Hello C1.DoStuff
  /// </summary>
  public abstract void DoStuff();
}

/// <summary>
/// Hello C2
/// </summary>
public class Class2 : Class1
{
  private const int Number = 1;

  public override void DoStuff()
  {
    throw new NotImplementedException();
  }
}
  1. Notice Class2.DoStuff raises CS1591
  2. Invoke CodeActions on it (Alt+Enter) and choose "Excplicitly inherit documentation" and apply

Expected Behavior:

public class Class2 : Class1
{
  private const int Number = 1;

  /// <inheritdoc/>
  public override void DoStuff()
  {
    throw new NotImplementedException();
  }
}

Actual Behavior:

public class Class2 : Class1
{
  private const int Number = 1;
/// <inheritdoc/>

  public override void DoStuff()
  {
    throw new NotImplementedException();
  }
}

Notice:

  • no leading whitespace
  • Trivia is "attached to" the bottom of member above (Number in this example)
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 27, 2022
@vatsalyaagrawal vatsalyaagrawal added Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 2, 2022
@vatsalyaagrawal vatsalyaagrawal added this to the Backlog milestone Jun 2, 2022
@OronDF343
Copy link

OronDF343 commented Aug 10, 2023

I'd like to add that this also occurs with default indentation settings (4 spaces), as well as with implementing interface members.

VS 17.7.0

@CyrusNajmabadi
Copy link
Member

We woudl take a community contribution here.

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: Completed
Development

Successfully merging a pull request may close this issue.

5 participants