Skip to content

Fix incorrect codespit of xml doc comments #76108

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

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

CyrusNajmabadi
Copy link
Member

Fixes #75838

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner November 26, 2024 22:10
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 26, 2024
@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal

namespace N
{
/// foo
/// $$
Copy link

@AlmightyLks AlmightyLks Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I can see from the written test, the expected behaviour is going to be that it generated another broken xml-doc line, assuming it is already in a valid state given the "///", instead of checking for a proper summary-wrapped xml doc?

We already have an analyzer/code-completion that turns

/// Bla
class C { }

into

/// <summary>
/// Bla
/// </summary>
class C { }

if we remove and re-add one of the slashes in the line.

However, if we have two lines within our broken summary, like so

/// Bla
/// Bla Bla
class C { }

removing and re-adding one of the slashes will turn it into a half-fixed summary block

/// <summary>
/// Bla
/// </summary>
/// Bla Bla
class C { }

This could make sense, if the lower summary xml docs were wrapped in other / already existing xml doc tags, but they are not, thus they should always belong to the upper generated summary xml.
Those are some of my thoughts on the behaviour, and why I dont think this fix necessarily fixes the underlying issue completely

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fixing the issue where the code spit is utterly wrong, duplicating code improperly.

You're welcome to submit other behavioral changes.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@CyrusNajmabadi CyrusNajmabadi merged commit ad6795a into dotnet:main Dec 3, 2024
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the fixXmlComments branch December 3, 2024 02:05
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 3, 2024
@dibarbet dibarbet modified the milestones: Next, 17.13 P3 Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Summary Xml-Doc actively breaks code
4 participants