-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
{ | ||
return; | ||
} | ||
var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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/> |
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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.
Fixes #61562