-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add parameter xml documentation code fix provider [work in progress] #10520
Add parameter xml documentation code fix provider [work in progress] #10520
Conversation
@dotnet-bot test eta please, test vsi please @dotnet/roslyn-ide Please review. |
@@ -2,6 +2,7 @@ Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.CSharpCompilationOptions( | |||
Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.CSharpCompilationOptions(Microsoft.CodeAnalysis.OutputKind outputKind, bool reportSuppressedDiagnostics, string moduleName, string mainTypeName, string scriptClassName, System.Collections.Generic.IEnumerable<string> usings, Microsoft.CodeAnalysis.OptimizationLevel optimizationLevel, bool checkOverflow, bool allowUnsafe, string cryptoKeyContainer, string cryptoKeyFile, System.Collections.Immutable.ImmutableArray<byte> cryptoPublicKey, bool? delaySign, Microsoft.CodeAnalysis.Platform platform, Microsoft.CodeAnalysis.ReportDiagnostic generalDiagnosticOption, int warningLevel, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, Microsoft.CodeAnalysis.ReportDiagnostic>> specificDiagnosticOptions, bool concurrentBuild, bool deterministic, Microsoft.CodeAnalysis.XmlReferenceResolver xmlReferenceResolver, Microsoft.CodeAnalysis.SourceReferenceResolver sourceReferenceResolver, Microsoft.CodeAnalysis.MetadataReferenceResolver metadataReferenceResolver, Microsoft.CodeAnalysis.AssemblyIdentityComparer assemblyIdentityComparer, Microsoft.CodeAnalysis.StrongNameProvider strongNameProvider) -> void | |||
Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.CSharpCompilationOptions(Microsoft.CodeAnalysis.OutputKind outputKind, string moduleName, string mainTypeName, string scriptClassName, System.Collections.Generic.IEnumerable<string> usings, Microsoft.CodeAnalysis.OptimizationLevel optimizationLevel, bool checkOverflow, bool allowUnsafe, string cryptoKeyContainer, string cryptoKeyFile, System.Collections.Immutable.ImmutableArray<byte> cryptoPublicKey, bool? delaySign, Microsoft.CodeAnalysis.Platform platform, Microsoft.CodeAnalysis.ReportDiagnostic generalDiagnosticOption, int warningLevel, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, Microsoft.CodeAnalysis.ReportDiagnostic>> specificDiagnosticOptions, bool concurrentBuild, bool deterministic, Microsoft.CodeAnalysis.XmlReferenceResolver xmlReferenceResolver, Microsoft.CodeAnalysis.SourceReferenceResolver sourceReferenceResolver, Microsoft.CodeAnalysis.MetadataReferenceResolver metadataReferenceResolver, Microsoft.CodeAnalysis.AssemblyIdentityComparer assemblyIdentityComparer, Microsoft.CodeAnalysis.StrongNameProvider strongNameProvider) -> void | |||
Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions.WithPublicSign(bool publicSign) -> Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions | |||
static Microsoft.CodeAnalysis.CSharp.SyntaxExtensions.GetElementKind(this Microsoft.CodeAnalysis.CSharp.Syntax.XmlNameAttributeSyntax attributeSyntax) -> Microsoft.CodeAnalysis.CSharp.Syntax.XmlNameAttributeElementKind |
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.
Making this public is going to require a much larger review. If you can avoid this changing public API surface area, it'd be helpful.
context.RegisterCodeFix( | ||
new AddParameterXmlDocumentationCodeAction(context.Document, parameterName, adjacentAttribute, | ||
adjacentAttributeIsBefore, isTypeParameter: false), | ||
diagnostic); |
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.
Extract this to a method and share common code with the code below.
I left some initial feedback, though I'm sure others will want to take a look as well. A couple of general notes:
|
private bool _adjacentAttributeIsBefore; | ||
private bool _isTypeParameter; | ||
|
||
public override string Title => _title; |
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 can be a getter-only auto-property so you don't have to bother having a field.
@DustinCampbell Thanks a lot for the feedback. Sorry it took me so long to respond. I'm working on a new version. |
Sorry. I didn't want to close it. I was just wondering what the "Close and Comment" meant. |
@3jr Have you had a chance to get back to this yet? If not, would you object to someone else picking up from your starting point and continuing? |
@Pilchie Hi, I have in fact fixed all of @DustinCampbell suggestions and with that rewrote quite a bit of the code. I than started to work on a batch fixer because batch fixing doesn't work at all at the moment. I got stuck there and just kind of stopped. I don't mind if someone else works on this. I will push my new branch this evening, in case someone wan't to look at it. |
Better: #12997 |
Here is my updated version. I haven't looked at it for a few weeks but if I remember correctly It worked okay: |
This is about #5611 and #7070.
Questions
TODO
/** */
comments are handled incorrect! An idea and details in Quick Fix: Add parameter to documentation #5611.// TODO
commentsMarginal remarks