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

Quick Info should merge elements with the same name #60725

Open
RikkiGibson opened this issue Apr 13, 2022 · 4 comments
Open

Quick Info should merge elements with the same name #60725

RikkiGibson opened this issue Apr 13, 2022 · 4 comments
Assignees
Milestone

Comments

@RikkiGibson
Copy link
Contributor

Related to dotnet/csharplang#6014

/// <summary>hi</summary>
/// <remarks>hello</remarks>
public partial class C {
}

/// <remarks>second</remarks>
public partial class C {
}

In the above scenario, Quick Info shows "hi" and "hello", but not "second". SharpLab

We confirmed that the compiler APIs do include both elements, so we think that Quick Info is "dropping" the second remarks tag here. Should Quick Info change to somehow merge these?

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 13, 2022
@jinujoseph jinujoseph added Question and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 19, 2022
@jinujoseph jinujoseph added this to the 17.3 milestone Apr 19, 2022
@sharwell
Copy link
Member

sharwell commented Apr 19, 2022

I can't find any indication in the specification to suggest that multiple <remarks> section elements are expected on a single code element. Considering that this is likely going to not be portable across documentation generation tools, it seems like the current IDE behavior reflects one reasonable interpretation of the presented code.

If we do make a change here, it should be coordinated across both the IDE and the known tools which process documentation files.

@RikkiGibson
Copy link
Contributor Author

I think at least we should reach a set of recommendations for whether/how source generators can add documentation to user-declared symbols. It would be useful to know if we already have analyzers to warn against certain duplicate elements.

@sharwell
Copy link
Member

sharwell commented May 2, 2022

It would be useful to know if we already have analyzers to warn against certain duplicate elements.

There are very few analyzers for documentation in use today. The one mentioned here would be a good candidate for a portability rule in DotNetAnalyzers.DocumentationAnalyzers.

@KathleenDollard
Copy link

Just weighing in on an opinion here:

  • We should merge different elements XML comments on partial methods aren't merged #60730
  • We should follow prior art on whether to merge things with the same name and this is likely to be tag specific (how could you merge a summary)
  • When there are conflicts, user code should win - either by being the only thing displayed or appearing first.

@arkalyanms arkalyanms modified the milestones: 17.3, 17.6 P2 Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants