public static async Task ComputeRefactoringAsync(RefactoringContext context, IndexerDeclarationSyntax indexerDeclaration) { if (!indexerDeclaration.HasSingleLineDocumentationComment()) { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); IPropertySymbol propertySymbol = semanticModel.GetDeclaredSymbol(indexerDeclaration); if (propertySymbol?.IsErrorType() == false) { ComputeRefactoring <IPropertySymbol>(context, indexerDeclaration, propertySymbol, propertySymbol.OverriddenProperty); } } }
public static async Task ComputeRefactoringAsync(RefactoringContext context, IndexerDeclarationSyntax indexerDeclaration) { if (!indexerDeclaration.HasSingleLineDocumentationComment()) { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); BaseDocumentationCommentInfo info = DocumentationCommentGenerator.GenerateFromBase(indexerDeclaration, semanticModel, context.CancellationToken); if (info.Success) { RegisterRefactoring(context, indexerDeclaration, info); } } }
public override SyntaxNode VisitIndexerDeclaration(IndexerDeclarationSyntax node) { bool isPubliclyVisible = node.IsPubliclyVisible(); node = (IndexerDeclarationSyntax)base.VisitIndexerDeclaration(node); if (isPubliclyVisible && !node.HasSingleLineDocumentationComment()) { return(DocumentationCommentGenerator.GenerateAndAttach(node, _settings)); } else { return(node); } }
public override SyntaxNode VisitIndexerDeclaration(IndexerDeclarationSyntax node) { bool isPubliclyVisible = node.IsPubliclyVisible(); node = (IndexerDeclarationSyntax)base.VisitIndexerDeclaration(node); if (isPubliclyVisible && !node.HasSingleLineDocumentationComment()) { return(AddDocumentationComment(node)); } else { return(node); } }