294 references to Annotation
ILLink.CodeFixProvider (2)
BaseAttributeCodeFixProvider.cs (1)
76 .WithAdditionalAnnotations (Simplifier.Annotation, Simplifier.AddImportsAnnotation);
DynamicallyAccessedMembersCodeFixProvider.cs (1)
138 .WithAdditionalAnnotations (Simplifier.Annotation, Simplifier.AddImportsAnnotation);
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\CodeFixVerifier.Helper.cs (1)
80var simplifiedDoc = Simplifier.ReduceAsync(document, Simplifier.Annotation).Result;
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\CodeFixVerifier.Helper.cs (1)
80var simplifiedDoc = Simplifier.ReduceAsync(document, Simplifier.Annotation).Result;
Microsoft.AspNetCore.Mvc.Api.Analyzers (5)
AddResponseTypeAttributeCodeFixAction.cs (5)
208.WithAdditionalAnnotations(Simplifier.Annotation), 220.WithAdditionalAnnotations(Simplifier.Annotation)); 224.WithAdditionalAnnotations(Simplifier.Annotation), 238.WithAdditionalAnnotations(Simplifier.Annotation), 250.WithAdditionalAnnotations(Simplifier.Annotation));
Microsoft.CodeAnalysis.CodeStyle.Fixes (23)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
131return (currentTarget.Parent, currentTarget.Parent.ReplaceNode(currentTarget, currentReplacement).WithAdditionalAnnotations(Simplifier.Annotation));
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (1)
80Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(enumerableType));
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
418.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 433.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 689.WithAdditionalAnnotations(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (1)
112conditionalExpression = conditionalExpression.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
102.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 153(o, r) => r.WithAdditionalAnnotations(Simplifier.Annotation, annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (4)
158through.WithAdditionalAnnotations(Simplifier.Annotation)); 173through = through.WithAdditionalAnnotations(Simplifier.Annotation); 177return through.WithAdditionalAnnotations(Simplifier.Annotation); 379.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
233.WithAdditionalAnnotations(Simplification.Simplifier.Annotation); 478s => s.WithAdditionalAnnotations(Simplifier.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
226factory.IdentifierName(member.Name)).WithAdditionalAnnotations(Simplification.Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
528.WithAdditionalAnnotations(Simplifier.Annotation); 572.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (1)
149.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
36protected static readonly Func<SyntaxNodeOrToken, bool> s_hasSimplifierAnnotation = n => n.HasAnnotation(Simplifier.Annotation); 282importDeclarations.Where(n => !isNodeOrTokenOutsideSimplifySpan(n) && n.HasAnnotation(Simplifier.Annotation)),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
29var dontSimplifyResult = !to.HasAnnotation(Simplifier.Annotation); 52var dontSimplifyResult = !to.HasAnnotation(Simplifier.Annotation);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (23)
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
153SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), newNameNode).WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
122fixedDeclaration = fixedDeclaration.WithAdditionalAnnotations(Simplifier.Annotation).WithTriviaFrom(declarationTypeToFix);
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
163return result.WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
161return await Simplifier.ReduceAsync(newDocument, Simplifier.Annotation, optionSet: null, cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (2)
67.WithAdditionalAnnotations(Simplifier.Annotation); 79.WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
42statement.Declaration.Type.WithAdditionalAnnotations(Simplifier.Annotation)));
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
129return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
292return result.WithAdditionalAnnotations(Simplifier.Annotation); 315result = result.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CastExpressionSyntaxExtensions.cs (1)
31.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
51? result.WithAdditionalAnnotations(Simplifier.Annotation) 82? result.WithAdditionalAnnotations(Simplifier.Annotation) 94return castExpression.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (4)
28=> typeSymbol.Accept(ExpressionSyntaxGeneratorVisitor.Create(nameSyntax))!.WithAdditionalAnnotations(Simplifier.Annotation); 52.WithAdditionalAnnotations(Simplifier.Annotation); 79.WithAdditionalAnnotations(Simplifier.Annotation); 89.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\StringExtensions.cs (1)
51token = token.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (3)
246=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 249=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 339=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (1)
54.WithAdditionalAnnotations(Simplifier.Annotation);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
213documentWithNameAndAnnotationsAdded.WithSyntaxRoot(updatedRoot), Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false); 279.WithRight(eventHookupExpression.Right.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.CSharp.Features (31)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
183currentNode = currentNode.WithAdditionalAnnotations(Simplifier.Annotation); 241newNode = newNode.WithAdditionalAnnotations(Simplifier.Annotation);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
137expressionToInline = expressionToInline.WithoutTrivia().Parenthesize().WithAdditionalAnnotations(Simplifier.Annotation, ExpressionAnnotation);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
209return rewrittenPattern.ConvertToSingleLine().WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation);
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (11)
119return Block(IfStatement(((WhereClauseSyntax)node).Condition.WithAdditionalAnnotations(Simplifier.Annotation).WithoutTrivia(), statement)); 207statement)))).WithAdditionalAnnotations(Simplifier.Annotation); 356methodSymbol.GenerateReturnTypeSyntax().WithAdditionalAnnotations(Simplifier.Annotation), 440nodesBeforeLocal = [parentStatement.ReplaceNode(invocationExpression, initializer.WithAdditionalAnnotations(Simplifier.Annotation))]; 453nodesAfterLocal = [parentStatement.ReplaceNode(invocationExpression, variableLocal.WithAdditionalAnnotations(Simplifier.Annotation))]; 502nodesAfter = new[] { ReturnStatement(variable).WithAdditionalAnnotations(Simplifier.Annotation) }; 529EqualsValueClause(expression))])).WithAdditionalAnnotations(Simplifier.Annotation); 583returnType: returnedType.GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.Annotation), 597var localFunctionInvocation = InvocationExpression(IdentifierName(localFunctionToken)).WithAdditionalAnnotations(Simplifier.Annotation); 598var newParentExpressionStatement = parentStatement.ReplaceNode(_source.WalkUpParentheses(), localFunctionInvocation.WithAdditionalAnnotations(Simplifier.Annotation)); 828statements.Add(statement.WithAdditionalAnnotations(Simplifier.Annotation));
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
462.WithAdditionalAnnotations(Simplifier.Annotation);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
825var methodName = CreateMethodNameForInvocation().WithAdditionalAnnotations(Simplifier.Annotation);
IntroduceVariable\CSharpIntroduceVariableService.Rewriter.cs (3)
52return newNode.WithNameEquals(NameEquals(IdentifierName(inferredName))).WithAdditionalAnnotations(Simplifier.Annotation); 70return newNode.WithNameColon(NameColon(IdentifierName(inferredName))).WithAdditionalAnnotations(Simplifier.Annotation); 86return newNode.WithAdditionalAnnotations(Simplifier.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
43newQualifiedName = newQualifiedName.WithAdditionalAnnotations(Simplifier.Annotation);
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.cs (2)
55Simplifier.Annotation, Formatter.Annotation, DoNotAllowVarAnnotation.Annotation); 60annotatedexpressionSyntax = annotatedexpressionSyntax.ReplaceNode(right, right.WithAdditionalAnnotations(Simplifier.Annotation));
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
153SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), newNameNode).WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
122fixedDeclaration = fixedDeclaration.WithAdditionalAnnotations(Simplifier.Annotation).WithTriviaFrom(declarationTypeToFix);
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
163return result.WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
164return await Simplifier.ReduceAsync(newDocument, Simplifier.Annotation, simplifierOptions, cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (2)
67.WithAdditionalAnnotations(Simplifier.Annotation); 79.WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
42statement.Declaration.Type.WithAdditionalAnnotations(Simplifier.Annotation)));
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
129return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation);
Microsoft.CodeAnalysis.CSharp.Workspaces (55)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
3118return addSimplifierAnnotation ? block.WithAdditionalAnnotations(Simplifier.Annotation) : block; 3322=> SyntaxFactory.QualifiedName((NameSyntax)left, (SimpleNameSyntax)right).WithAdditionalAnnotations(Simplifier.Annotation);
Rename\CSharpRenameRewriterLanguageService.cs (1)
624newToken = newToken.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\CSharpSimplificationService.cs (2)
86var rewrittenToken = TryEscapeIdentifierToken(rewriter.VisitToken(token), token.Parent).WithAdditionalAnnotations(Simplifier.Annotation); 135.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\CSharpSimplificationService.Expander.cs (14)
188var newParameter = parameters[i].WithType(typeSyntax).WithAdditionalAnnotations(Simplifier.Annotation); 235simpleLambda.Body).WithAdditionalAnnotations(Simplifier.Annotation); 266.WithAdditionalAnnotations(Simplifier.Annotation) 337.WithAdditionalAnnotations(Simplifier.Annotation); 401.WithAdditionalAnnotations(Simplifier.Annotation), 406.WithAdditionalAnnotations(Simplifier.Annotation); 413.WithAdditionalAnnotations(Simplifier.Annotation); 488.WithAdditionalAnnotations(Simplifier.Annotation); 609identifier = TryEscapeIdentifierToken(identifier, originalSimpleName).WithAdditionalAnnotations(Simplifier.Annotation); 659.WithAdditionalAnnotations(Simplifier.Annotation); 713var result = newNode.WithAdditionalAnnotations(Simplifier.Annotation); 756.WithAdditionalAnnotations(Simplifier.Annotation); 1112newMemberAccess = originalNode.Expression.CopyAnnotationsTo(newMemberAccess).WithAdditionalAnnotations(Simplifier.Annotation); 1126.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (2)
66_simplifyAllDescendants = _simplifyAllDescendants || node.HasAnnotation(Simplifier.Annotation); 104_simplifyAllDescendants = _simplifyAllDescendants || token.HasAnnotation(Simplifier.Annotation);
Simplification\Reducers\AbstractCSharpReducer.AbstractReductionRewriter.cs (2)
134if (!this.alwaysSimplify && !node.HasAnnotation(Simplifier.Annotation)) 165return token.HasAnnotation(Simplifier.Annotation)
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (1)
65.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\Reducers\CSharpMiscellaneousReducer.cs (2)
76newParameterSyntax = SimplificationHelpers.CopyAnnotations(node, newParameterSyntax).WithoutAnnotations(Simplifier.Annotation); 104return SimplificationHelpers.CopyAnnotations(parenthesizedLambda, newSimpleLambda).WithoutAnnotations(Simplifier.Annotation);
Simplification\Reducers\CSharpNameReducer.cs (1)
62return node.WithoutAnnotations(Simplifier.Annotation);
Simplification\Reducers\CSharpNameReducer.Rewriter.cs (10)
29this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 47this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 65this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 83this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 101this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 119this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 137this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 155this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 173this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 191this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation);
Simplification\Reducers\CSharpVarReducer.Rewriter.cs (1)
28if (!alwaysSimplify && !typeSyntax.HasAnnotation(Simplifier.Annotation))
Simplification\Simplifiers\ExpressionSimplifier.cs (2)
293.WithAdditionalAnnotations(Simplifier.Annotation); 304.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
292return result.WithAdditionalAnnotations(Simplifier.Annotation); 315result = result.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CastExpressionSyntaxExtensions.cs (1)
31.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
51? result.WithAdditionalAnnotations(Simplifier.Annotation) 82? result.WithAdditionalAnnotations(Simplifier.Annotation) 94return castExpression.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (4)
28=> typeSymbol.Accept(ExpressionSyntaxGeneratorVisitor.Create(nameSyntax))!.WithAdditionalAnnotations(Simplifier.Annotation); 52.WithAdditionalAnnotations(Simplifier.Annotation); 79.WithAdditionalAnnotations(Simplifier.Annotation); 89.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\StringExtensions.cs (1)
51token = token.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (3)
246=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 249=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 339=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (1)
54.WithAdditionalAnnotations(Simplifier.Annotation);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.cs (1)
52? c.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol), Simplifier.Annotation)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
CodeGeneration\AbstractCodeGenerationTests.cs (1)
40root.WithAdditionalAnnotations(Simplifier.Annotation));
CodeGeneration\CodeGenerationTests.cs (1)
959var simplified = Simplifier.ReduceAsync(this.Document, Simplifier.Annotation, simplifierOptions, CancellationToken.None).Result;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (8)
Expansion\AbstractExpansionTest.vb (1)
44document = Await Simplifier.ReduceAsync(document, Simplifier.Annotation, cleanupOptions.SimplifierOptions, CancellationToken.None)
Simplification\AbstractSimplificationTests.vb (6)
82root = root.ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation)) 88root = root.ReplaceToken(token, token.WithAdditionalAnnotations(Simplifier.Annotation)) 94root = root.ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation)) 100root = root.ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation)) 106root = root.ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation)) 121simplifiedDocument = Await Simplifier.ReduceAsync(document, Simplifier.Annotation, optionSet)
Simplification\ParameterSimplificationTests.vb (1)
27(Await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.Features (26)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
153Simplifier.Annotation,
ChangeSignature\AbstractChangeSignatureService.cs (1)
427var reducedDoc = await Simplifier.ReduceAsync(docWithImports, Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken: cancellationToken).ConfigureAwait(false);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (2)
634root = root.WithAdditionalAnnotations(Simplifier.Annotation); 734editor.ReplaceNode(oldNode, newNode.WithAdditionalAnnotations(Simplifier.Annotation));
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
221document = await Simplifier.ReduceAsync(document, Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
51.WithAdditionalAnnotations(Simplifier.Annotation);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
215? converted.WithAdditionalAnnotations(Simplifier.Annotation)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
359fullTypeName = fullTypeName.WithAdditionalAnnotations(Simplifier.Annotation)
EncapsulateField\AbstractEncapsulateFieldService.cs (3)
358return Simplifier.Annotation.AddAnnotationToSymbol( 387assigned.WithAdditionalAnnotations(Simplifier.Annotation), 405value.WithAdditionalAnnotations(Simplifier.Annotation));
ExtractInterface\AbstractExtractInterfaceService.cs (1)
304Simplifier.Annotation,
ExtractMethod\MethodExtractor.cs (1)
152var simplifiedDocument = await Simplifier.ReduceAsync(annotatedDocument, Simplifier.Annotation, this.Options.CodeCleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (2)
297.WithAdditionalAnnotations(Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType))); 324.WithAdditionalAnnotations(Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType)));
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
329.WithAdditionalAnnotations(Simplifier.Annotation);
Snippets\SnippetFunctionService.cs (1)
152var updatedRoot = syntaxRoot.ReplaceNode(nodeToReplace, nodeToReplace.WithAdditionalAnnotations(typeAnnotation, Simplifier.Annotation));
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
83var reformatSnippetNode = snippetExpressionNode.WithAdditionalAnnotations(FindSnippetAnnotation, Simplifier.Annotation, SymbolAnnotation.Create(consoleSymbol!), Formatter.Annotation);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
215var reformatSnippetNode = snippetExpressionNode.WithAdditionalAnnotations(FindSnippetAnnotation, Simplifier.Annotation, Formatter.Annotation);
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
131return (currentTarget.Parent, currentTarget.Parent.ReplaceNode(currentTarget, currentReplacement).WithAdditionalAnnotations(Simplifier.Annotation));
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (1)
80Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(enumerableType));
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
418.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 433.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 689.WithAdditionalAnnotations(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (1)
112conditionalExpression = conditionalExpression.WithAdditionalAnnotations(Simplifier.Annotation);
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
ExternalAccess\Razor\SimplifyMethodHandler.cs (1)
63var annotatedSyntaxRoot = newTree.GetRoot(cancellationToken).ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (16)
src\Analyzers\VisualBasic\CodeFixes\ConvertTypeOfToNameOf\VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
43WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52Return statement.ReplaceNode(declarator, declarator.WithAdditionalAnnotations(Simplifier.Annotation))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.StringPiece.vb (1)
73Return result.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (3)
144Return DirectCast(expression, MemberAccessExpressionSyntax).WithAdditionalAnnotations(Simplifier.Annotation) 158Return invocation.WithAdditionalAnnotations(Simplifier.Annotation) 404.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
38result.WithAdditionalAnnotations(Simplifier.Annotation), 113.WithAdditionalAnnotations(Simplifier.Annotation) 121.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\INamespaceOrTypeSymbolExtensions.vb (1)
15Return symbol.Accept(TypeSyntaxGeneratorVisitor.Create(addGlobal)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ITypeSymbolExtensions.vb (1)
15Return typeSymbol.Accept(New ExpressionSyntaxGeneratorVisitor(addGlobal:=True)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (2)
78token = token.WithAdditionalAnnotations(Simplifier.Annotation) 92Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (2)
525Return SyntaxFactory.DirectCastExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation) 567Return SyntaxFactory.CTypeExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\VisualBasicSimplificationHelpers.vb (1)
30.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (1)
66newDocument = Await Simplifier.ReduceAsync(newDocument, Simplifier.Annotation, simplifierOptions, cancellationToken).ConfigureAwait(False)
Utilities\CommandHandlers\AbstractImplementAbstractClassOrInterfaceCommandHandler.vb (1)
188newDocument = Await Simplifier.ReduceAsync(newDocument, Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(True)
Microsoft.CodeAnalysis.VisualBasic.Features (10)
AddImport\VisualBasicAddImportFeatureService.vb (1)
210nameSyntax = nameSyntax.WithAdditionalAnnotations(Simplifier.Annotation)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.ReferenceRewriter.vb (1)
61.WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (1)
360.WithAdditionalAnnotations(Simplifier.Annotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (1)
347Dim methodName = CreateMethodNameForInvocation().WithAdditionalAnnotations(Simplifier.Annotation)
GenerateType\VisualBasicGenerateTypeService.vb (1)
664Dim addedCompilationRoot = compilationRoot.AddImportsStatement(newImport, addImportOptions.PlaceSystemNamespaceFirst, Formatter.Annotation, Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService.Rewriter.vb (1)
42Return newNode.WithAdditionalAnnotations(Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (1)
34name:=SyntaxFactory.IdentifierName(newNameToken)).WithAdditionalAnnotations(Simplifier.Annotation)
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.vb (1)
42Return expression.WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\ConvertTypeOfToNameOf\VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
43WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52Return statement.ReplaceNode(declarator, declarator.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (53)
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
174SyntaxFactory.SeparatedList(typeArguments.Cast(Of TypeSyntax)()))).WithAdditionalAnnotations(Simplifier.Annotation)
Rename\VisualBasicRenameRewriterLanguageService.vb (1)
580newToken = newToken.WithAdditionalAnnotations(Simplifier.Annotation)
Simplification\Reducers\AbstractVisualBasicReducer.AbstractReductionRewriter.vb (2)
91If Not _alwaysSimplify AndAlso Not node.HasAnnotation(Simplifier.Annotation) Then 134If Not _alwaysSimplify AndAlso Not token.HasAnnotation(Simplifier.Annotation) Then
Simplification\Reducers\VisualBasicMiscellaneousReducer.vb (1)
36newParameter = SimplificationHelpers.CopyAnnotations(parameter, newParameter).WithoutAnnotations(Simplifier.Annotation)
Simplification\Reducers\VisualBasicNameReducer.Rewriter.vb (6)
21Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation) 37Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation) 53Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation) 69Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation) 85Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation) 101Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation)
Simplification\Reducers\VisualBasicNameReducer.vb (1)
49Return node.WithoutAnnotations(Simplifier.Annotation)
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
46Return replacementNode.WithoutAnnotations(Simplifier.Annotation)
Simplification\Simplifiers\ExpressionSimplifier.vb (3)
187replacementNode = memberAccess.Update(memberAccess.Kind, newLeft, memberAccess.OperatorToken, memberAccess.Name).WithAdditionalAnnotations(Simplifier.Annotation) 206replacementNode = qualifiedName.Update(DirectCast(newLeft, NameSyntax), qualifiedName.DotToken, qualifiedName.Right).WithAdditionalAnnotations(Simplifier.Annotation) 260replacementNode = containingType.GenerateTypeSyntax().WithLeadingTrivia(left.GetLeadingTrivia()).WithTrailingTrivia(left.GetTrailingTrivia()).WithAdditionalAnnotations(Simplifier.Annotation)
Simplification\VisualBasicSimplificationService.Expander.vb (20)
117.WithAdditionalAnnotations(Simplifier.Annotation) 120Return SyntaxFactory.Parameter(newNode.AttributeLists, newNode.Modifiers, newNode.Identifier, asClause, newNode.Default).WithAdditionalAnnotations(Simplifier.Annotation) 139.WithAdditionalAnnotations(Simplifier.Annotation) 157.WithAdditionalAnnotations(Simplifier.Annotation) 181.WithAdditionalAnnotations(Simplifier.Annotation) 204.WithAdditionalAnnotations(Simplifier.Annotation) 258newMemberAccess = originalNode.Expression.CopyAnnotationsTo(newMemberAccess).WithAdditionalAnnotations(Simplifier.Annotation) 267.WithAdditionalAnnotations(Simplifier.Annotation) 275Return originalNode.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Simplifier.Annotation) 289.WithAdditionalAnnotations(Simplifier.Annotation) 311WithAdditionalAnnotations(Simplifier.Annotation). 343.WithAdditionalAnnotations(Simplifier.Annotation) 386WithAdditionalAnnotations(Simplifier.Annotation) 433.WithAdditionalAnnotations(Simplifier.Annotation, SimplificationHelpers.SimplifyModuleNameAnnotation), 467.WithAdditionalAnnotations(Simplifier.Annotation, SimplificationHelpers.SimplifyModuleNameAnnotation), 519.WithAdditionalAnnotations(Simplifier.Annotation) 605newNode = DirectCast(newNode, SimpleNameSyntax).WithIdentifier(identifier).WithAdditionalAnnotations(Simplifier.Annotation) 640.WithAdditionalAnnotations(Simplifier.Annotation) 676newNode = newNode.WithAdditionalAnnotations(Simplifier.Annotation) 695.WithAdditionalAnnotations(Simplifier.Annotation)
Simplification\VisualBasicSimplificationService.NodesAndTokensToReduceComputer.vb (3)
55Me._simplifyAllDescendants = Me._simplifyAllDescendants OrElse node.HasAnnotation(Simplifier.Annotation) 95Me._simplifyAllDescendants = Me._simplifyAllDescendants OrElse token.HasAnnotation(Simplifier.Annotation) 160Me._simplifyAllDescendants = Me._simplifyAllDescendants OrElse node.HasAnnotation(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.StringPiece.vb (1)
73Return result.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (3)
144Return DirectCast(expression, MemberAccessExpressionSyntax).WithAdditionalAnnotations(Simplifier.Annotation) 158Return invocation.WithAdditionalAnnotations(Simplifier.Annotation) 404.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
38result.WithAdditionalAnnotations(Simplifier.Annotation), 113.WithAdditionalAnnotations(Simplifier.Annotation) 121.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\INamespaceOrTypeSymbolExtensions.vb (1)
15Return symbol.Accept(TypeSyntaxGeneratorVisitor.Create(addGlobal)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ITypeSymbolExtensions.vb (1)
15Return typeSymbol.Accept(New ExpressionSyntaxGeneratorVisitor(addGlobal:=True)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (2)
78token = token.WithAdditionalAnnotations(Simplifier.Annotation) 92Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (2)
525Return SyntaxFactory.DirectCastExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation) 567Return SyntaxFactory.CTypeExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\VisualBasicSimplificationHelpers.vb (1)
30.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
56Return c.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol), Simplifier.Annotation)
Microsoft.CodeAnalysis.Workspaces (29)
CodeActions\CodeAction.cs (1)
471/// Reducing nodes annotated with <see cref="Simplifier.Annotation"/>
Editing\SyntaxGenerator.cs (1)
1912name = QualifiedName(name, IdentifierName(part)).WithAdditionalAnnotations(Simplifier.Annotation);
Rename\ConflictEngine\RenamedSpansTracker.cs (1)
158document = await Simplifier.ReduceAsync(document, Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false);
Simplification\Simplifier.cs (10)
60/// Expand qualifying parts of the specified subtree, annotating the parts using the <see cref="Annotation" /> annotation. 79/// Expand qualifying parts of the specified subtree, annotating the parts using the <see cref="Annotation" /> annotation. 90/// Expand qualifying parts of the specified subtree, annotating the parts using the <see cref="Annotation" /> annotation. 110/// Expand qualifying parts of the specified subtree, annotating the parts using the <see cref="Annotation" /> annotation. 124/// Expand qualifying parts of the specified subtree, annotating the parts using the <see cref="Annotation" /> annotation. 135/// Expand qualifying parts of the specified subtree, annotating the parts using the <see cref="Annotation" /> annotation. 150/// Reduce all sub-trees annotated with <see cref="Annotation" /> found within the document. The annotated node and all child nodes will be reduced. 172/// Reduce the sub-trees annotated with <see cref="Annotation" /> found within the subtrees identified with the specified <paramref name="annotation"/>. 200/// Reduce the sub-trees annotated with <see cref="Annotation" /> found within the specified span. 219/// Reduce the sub-trees annotated with <see cref="Annotation" /> found within the specified spans.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
102.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 153(o, r) => r.WithAdditionalAnnotations(Simplifier.Annotation, annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (4)
158through.WithAdditionalAnnotations(Simplifier.Annotation)); 173through = through.WithAdditionalAnnotations(Simplifier.Annotation); 177return through.WithAdditionalAnnotations(Simplifier.Annotation); 379.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
233.WithAdditionalAnnotations(Simplification.Simplifier.Annotation); 478s => s.WithAdditionalAnnotations(Simplifier.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
226factory.IdentifierName(member.Name)).WithAdditionalAnnotations(Simplification.Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
528.WithAdditionalAnnotations(Simplifier.Annotation); 572.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (1)
149.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
36protected static readonly Func<SyntaxNodeOrToken, bool> s_hasSimplifierAnnotation = n => n.HasAnnotation(Simplifier.Annotation); 282importDeclarations.Where(n => !isNodeOrTokenOutsideSimplifySpan(n) && n.HasAnnotation(Simplifier.Annotation)),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
29var dontSimplifyResult = !to.HasAnnotation(Simplifier.Annotation); 52var dontSimplifyResult = !to.HasAnnotation(Simplifier.Annotation);
Microsoft.VisualStudio.LanguageServices (1)
Venus\ContainedLanguageCodeSupport.cs (1)
227targetDocument.WithSyntaxRoot(newRoot), Simplifier.Annotation, options.CleanupOptions.SimplifierOptions, cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetSyntaxRootSynchronously(cancellationToken);
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (1)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (1)
155WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation)