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

Fix location where inheritdoc doc comment is placed #76024

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

CyrusNajmabadi
Copy link
Member

Fixes #61562

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner November 22, 2024 03:16
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 22, 2024
{
return;
}
var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

it's a c# fixer. it always has a root.


SemanticModel? semanticModel = null;
var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

semantic models cost nothing in fixers. no point deferring.

SourceText? sourceText = null;
var options = await document.GetLineFormattingOptionsAsync(cancellationToken).ConfigureAwait(false);
var newLine = options.NewLine;
var sourceText = await document.GetValueTextAsync(cancellationToken).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

we only got here because we want to fix things. deferring any of this stuff is pointless. the compiler already said there was a problem.

// Comment
/// <inheritdoc/>
Copy link
Member Author

Choose a reason for hiding this comment

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

the new form is as better than the old form.

// Comment 1
/* Comment 2 */ public /* Comment 3 */ override void M /* Comment 4 */ () /* Comment 5 */ { } /* Comment 6 */
/* Comment 2 */ /// <inheritdoc/>
public /* Comment 3 */ override void M /* Comment 4 */ () /* Comment 5 */ { } /* Comment 6 */
Copy link
Member Author

Choose a reason for hiding this comment

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

this test case is pointless. no one writes cod ethis way. keeping things the same as they were before is not a desire here.

@CyrusNajmabadi CyrusNajmabadi merged commit 0d2d498 into dotnet:main Nov 22, 2024
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the inheritDocLocation branch November 22, 2024 19:36
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Nov 22, 2024
@jjonescz jjonescz modified the milestones: Next, 17.13 P2 Nov 25, 2024
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.

CS1591 CodeFix does not work correctly when there is anything but OpenBraceToken
3 participants