512 references to WithAdditionalAnnotations
IdeCoreBenchmarks (1)
FormatterBenchmarks.cs (1)
54var root = document.GetSyntaxRootAsync(CancellationToken.None).Result.WithAdditionalAnnotations(Formatter.Annotation);
ILLink.CodeFixProvider (2)
BaseAttributeCodeFixProvider.cs (1)
76 .WithAdditionalAnnotations (Simplifier.Annotation, Simplifier.AddImportsAnnotation);
DynamicallyAccessedMembersCodeFixProvider.cs (1)
138 .WithAdditionalAnnotations (Simplifier.Annotation, Simplifier.AddImportsAnnotation);
Microsoft.AspNetCore.App.CodeFixes (2)
Http\HeaderDictionaryAddFixer.cs (1)
75root.ReplaceNode(diagnosticTarget, invocation.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation, annotation))));
RouteParameterUnusedParameterFixer.cs (1)
88var type = resolvedType.WithAdditionalAnnotations(new SyntaxAnnotation("CodeAction_Navigation"));
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 (1)
Syntax\SyntaxNodeExtensions_Tracking.cs (1)
53return root.ReplaceNodes(nodes, (n, r) => n.HasAnnotation(GetId(n)!) ? r : r.WithAdditionalAnnotations(GetId(n)!));
Microsoft.CodeAnalysis.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
212var annotatedExpression = _newExpressionForReplace.WithAdditionalAnnotations(annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (1)
76=> node.WithAdditionalAnnotations(this.GetOrCreateRealAnnotations(annotations).ToArray());
Microsoft.CodeAnalysis.CodeStyle.Fixes (38)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
131return (currentTarget.Parent, currentTarget.Parent.ReplaceNode(currentTarget, currentReplacement).WithAdditionalAnnotations(Simplifier.Annotation));
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
125.WithAdditionalAnnotations(Formatter.Annotation); 128parameterDeclaration = parameterDeclaration.WithAdditionalAnnotations(
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121var newRoot = root.ReplaceNode(docCommentNode, newDocComment.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
93.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
104.WithAdditionalAnnotations(Formatter.Annotation, annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (2)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation) 199.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
38switchNode, switchExpression).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
39switchNode, switchOperation).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (6)
281root = root.ReplaceNodes(memberDeclarations, computeReplacementNode: (_, n) => n.WithAdditionalAnnotations(s_memberAnnotation)); 419.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 434.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 589declarationStatement = declarationStatement.WithAdditionalAnnotations(s_unusedLocalDeclarationAnnotation); 641nodeReplacementMap.Add(localDeclarationStatement, localDeclarationStatement.WithAdditionalAnnotations(s_existingLocalDeclarationWithoutInitializerAnnotation)); 690.WithAdditionalAnnotations(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
112conditionalExpression = conditionalExpression.WithAdditionalAnnotations(Simplifier.Annotation); 118conditionalExpression = conditionalExpression.WithAdditionalAnnotations(
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
80.WithAdditionalAnnotations(Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
73? node.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
40? syntax?.WithAdditionalAnnotations(codeGenerationSymbol.GetAnnotations()) 44=> node.WithAdditionalAnnotations(Formatter.Annotation, CodeGenerator.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
102.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (5)
159through.WithAdditionalAnnotations(Simplifier.Annotation)); 174through = through.WithAdditionalAnnotations(Simplifier.Annotation); 178return through.WithAdditionalAnnotations(Simplifier.Annotation); 352.WithAdditionalAnnotations(Simplifier.Annotation); 425factory.IdentifierName(parameter.Name))).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
233.WithAdditionalAnnotations(Simplification.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\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (6)
127: explicitDeclarationStatement.WithAdditionalAnnotations(warningAnnotation); 128declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); 142newNextStatement.WithAdditionalAnnotations(Formatter.Annotation).WithLeadingTrivia( 152(current, generator) => current.WithAdditionalAnnotations(Formatter.Annotation).WithPrependedLeadingTrivia( 164: declarationStatement.WithAdditionalAnnotations(warningAnnotation); 172declarationStatement.WithAdditionalAnnotations(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
256var newRoot = root.ReplaceNode(nodeOrToken.AsNode()!, currentNode.WithAdditionalAnnotations(marker));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (1)
35to = to.WithAdditionalAnnotations(DoNotSimplifyAnnotation);
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
58ConstantPattern(ParenthesizedExpression(binaryExpression.Right.WithAdditionalAnnotations(s_annotation)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
199SyntaxFactory.IdentifierName("var").WithTriviaFrom(declarationTypeNode).WithAdditionalAnnotations(annotation));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (52)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (2)
63(c, _) => c.WithAdditionalAnnotations(Formatter.Annotation)); 83.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
87converted.WithAdditionalAnnotations(annotation)); 295(_, _) => converted.WithAdditionalAnnotations(annotation),
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
269node.Expression.Cast(expressionConvertedType).WithAdditionalAnnotations(Formatter.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\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
305newType = newType.WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation); 365.WithAdditionalAnnotations(annotation));
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
108newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation); 148newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
77.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
193localFunctionWithNewParameters = localFunctionWithNewParameters.WithAdditionalAnnotations(annotation);
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (2)
116var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation); 152return newReturnType.WithTriviaFrom(returnTypeSyntax).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
65? node.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (3)
67.WithAdditionalAnnotations(Simplifier.Annotation); 73return castExpression.Uncast().WithAdditionalAnnotations(Formatter.Annotation) 79.WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (3)
58.WithAdditionalAnnotations(Formatter.Annotation); 67.WithAdditionalAnnotations(Formatter.Annotation)); 76.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
166return proposedReplacementNode.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
86.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
125.WithAdditionalAnnotations(annotation);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
59.WithAdditionalAnnotations(dummyObjectAnnotation);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
84.WithAdditionalAnnotations(dummyObjectAnnotation);
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
33return newCreation.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
42statement.Declaration.Type.WithAdditionalAnnotations(Simplifier.Annotation)));
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
71editor.ReplaceNode(accessorList, (current, _) => current.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
23=> UpdateWorker(semanticModel, originalDeclaration, currentDeclaration, cancellationToken).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
88var argument = Argument(rangeExpression).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
159.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
129return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
95return newIf.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
155a => a.WithTarget(AttributeTargetSpecifier(MethodKeyword)).WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation))); 168.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
100.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
32? result.WithAdditionalAnnotations(Formatter.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
294return result.WithAdditionalAnnotations(Simplifier.Annotation); 317result = result.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\BaseNamespaceDeclarationSyntaxExtensions.cs (1)
27newUsings = newUsings.Select(u => u.WithAdditionalAnnotations(annotations)).ToList();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CastExpressionSyntaxExtensions.cs (1)
31.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
137[.. usings.Select(u => u.WithAdditionalAnnotations(annotations))]);
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 (2)
28=> typeSymbol.Accept(ExpressionSyntaxGeneratorVisitor.Create(nameSyntax))!.WithAdditionalAnnotations(Simplifier.Annotation); 52.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
230.WithAdditionalAnnotations(Formatter.Annotation); 251.WithAdditionalAnnotations(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (1)
65return node.WithAdditionalAnnotations(s_annotation);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
302.WithRight(eventHookupExpression.Right.WithAdditionalAnnotations(Simplifier.Annotation)) 303.WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.Features (93)
AddImport\CSharpAddImportFeatureService.cs (2)
427.WithAdditionalAnnotations(Formatter.Annotation), 480.WithAdditionalAnnotations(Formatter.Annotation);
ChangeSignature\UnifiedArgumentSyntax.cs (1)
59=> new UnifiedArgumentSyntax(_argument.WithAdditionalAnnotations(annotation));
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
183currentNode = currentNode.WithAdditionalAnnotations(Simplifier.Annotation); 241newNode = newNode.WithAdditionalAnnotations(Simplifier.Annotation);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (3)
144document = await document.ReplaceNodeAsync(declarator, declarator.WithAdditionalAnnotations(DefinitionAnnotation), cancellationToken).ConfigureAwait(false); 310newLocalDeclaration.WithAdditionalAnnotations(Formatter.Annotation)); 379expressionToInline = expressionToInline.WithAdditionalAnnotations(Formatter.Annotation);
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
101.WithAdditionalAnnotations(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (1)
185SyntaxFactory.IdentifierName(MethodName))).WithAdditionalAnnotations(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\YieldReturnConverter.cs (1)
38SyntaxFactory.ReturnStatement(queryOrLinqInvocationExpression).WithAdditionalAnnotations(Formatter.Annotation));
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (10)
119return Block(IfStatement(((WhereClauseSyntax)node).Condition.WithAdditionalAnnotations(Simplifier.Annotation).WithoutTrivia(), statement)); 441nodesBeforeLocal = [parentStatement.ReplaceNode(invocationExpression, initializer.WithAdditionalAnnotations(Simplifier.Annotation))]; 454nodesAfterLocal = [parentStatement.ReplaceNode(invocationExpression, variableLocal.WithAdditionalAnnotations(Simplifier.Annotation))]; 503nodesAfter = new[] { ReturnStatement(variable).WithAdditionalAnnotations(Simplifier.Annotation) }; 530EqualsValueClause(expression))])).WithAdditionalAnnotations(Simplifier.Annotation); 598var localFunctionInvocation = InvocationExpression(IdentifierName(localFunctionToken)).WithAdditionalAnnotations(Simplifier.Annotation); 599var newParentExpressionStatement = parentStatement.ReplaceNode(_source.WalkUpParentheses(), localFunctionInvocation.WithAdditionalAnnotations(Simplifier.Annotation)); 701forEachStatement.Statement).WithAdditionalAnnotations(Formatter.Annotation), queryExpressionProcessingInfo); 723expression => forEachStatement.Statement.WithAdditionalAnnotations(Formatter.Annotation), 829statements.Add(statement.WithAdditionalAnnotations(Simplifier.Annotation));
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
314var constructorDeclaration = CreateConstructorDeclaration().WithAdditionalAnnotations(constructorAnnotation);
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
90method = method.WithReturnType(method.ReturnType.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)); 131var statement = globalStatement.Statement.WithAdditionalAnnotations(Formatter.Annotation);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (2)
94directives.Add(UsingDirective(name).WithAdditionalAnnotations(annotation)); 232globalStatements.Add(GlobalStatement(statement).WithAdditionalAnnotations(Formatter.Annotation));
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
60var updatedDeclarator = declarator.WithIdentifier(newIdentifier).WithAdditionalAnnotations(tempAnnotation); 77.WithAdditionalAnnotations(Formatter.Annotation)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
140return container.CopyAnnotationsTo(callSiteGenerator.Generate()).WithAdditionalAnnotations(Formatter.Annotation); 570var methodName = CreateMethodNameForInvocation().WithAdditionalAnnotations(Simplifier.Annotation);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
167.WithAdditionalAnnotations(enclosingStatementAnnotation);
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
212declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation);
InitializeParameter\InitializeParameterHelpers.cs (2)
116(currentBlock, _) => currentBlock.WithAdditionalAnnotations(Formatter.Annotation)); 174.WithAdditionalAnnotations(Formatter.Annotation);
IntroduceVariable\CSharpIntroduceVariableService.Rewriter.cs (2)
35.WithAdditionalAnnotations(_replacementAnnotation); 50return newNode.WithAdditionalAnnotations(Simplifier.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
53EqualsValueClause(expression.WithoutTrivia()))])).WithAdditionalAnnotations(Formatter.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (4)
113.WithAdditionalAnnotations(Formatter.Annotation); 245.WithAdditionalAnnotations(Formatter.Annotation); 295declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); 332Block(root.GetCurrentNode(statement)).WithAdditionalAnnotations(Formatter.Annotation));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (1)
38expression).WithAdditionalAnnotations(Formatter.Annotation);
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
177: updatedIf.WithAdditionalAnnotations(Formatter.Annotation);
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (5)
155return property.WithAdditionalAnnotations(Formatter.Annotation); 189.WithAdditionalAnnotations(Formatter.Annotation); 202.WithAdditionalAnnotations(Formatter.Annotation); 228return accessor.WithBody(getMethodDeclaration.Body.WithAdditionalAnnotations(Formatter.Annotation)); 277return accessor.WithBody(body.WithAdditionalAnnotations(Formatter.Annotation));
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (2)
142.WithAdditionalAnnotations(Formatter.Annotation); 213.WithAdditionalAnnotations(Formatter.Annotation);
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
356return expr.WithAdditionalAnnotations(Formatter.Annotation);
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.cs (2)
54var annotatedexpressionSyntax = expressionSyntax.WithAdditionalAnnotations( 60annotatedexpressionSyntax = annotatedexpressionSyntax.ReplaceNode(right, right.WithAdditionalAnnotations(Simplifier.Annotation));
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
58ConstantPattern(ParenthesizedExpression(binaryExpression.Right.WithAdditionalAnnotations(s_annotation)))
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (2)
63(c, _) => c.WithAdditionalAnnotations(Formatter.Annotation)); 83.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
87converted.WithAdditionalAnnotations(annotation)); 295(_, _) => converted.WithAdditionalAnnotations(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\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
305newType = newType.WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation); 365.WithAdditionalAnnotations(annotation));
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
108newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation); 148newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
77.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
193localFunctionWithNewParameters = localFunctionWithNewParameters.WithAdditionalAnnotations(annotation);
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (2)
116var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation); 152return newReturnType.WithTriviaFrom(returnTypeSyntax).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
65? node.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (2)
67.WithAdditionalAnnotations(Simplifier.Annotation); 79.WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (3)
58.WithAdditionalAnnotations(Formatter.Annotation); 67.WithAdditionalAnnotations(Formatter.Annotation)); 76.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
166return proposedReplacementNode.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
86.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
125.WithAdditionalAnnotations(annotation);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
59.WithAdditionalAnnotations(dummyObjectAnnotation);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
84.WithAdditionalAnnotations(dummyObjectAnnotation);
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
33return newCreation.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
42statement.Declaration.Type.WithAdditionalAnnotations(Simplifier.Annotation)));
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (2)
71editor.ReplaceNode(accessorList, (current, _) => current.WithAdditionalAnnotations(Formatter.Annotation)); 86.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
23=> UpdateWorker(semanticModel, originalDeclaration, currentDeclaration, cancellationToken).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
88var argument = Argument(rangeExpression).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
159.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
129return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
95return newIf.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
155a => a.WithTarget(AttributeTargetSpecifier(MethodKeyword)).WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation))); 168.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
100.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (1)
182.WithAdditionalAnnotations(Formatter.Annotation);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
213.WithAdditionalAnnotations(s_referenceAnnotation));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (7)
Syntax\SyntaxAnnotationTests.cs (6)
164var annotatedNode = node.WithAdditionalAnnotations(annotation1); 174var twiceAnnotatedNode = node2.WithAdditionalAnnotations(annotation2); 288var annotatedNode = lastChildOfFirstNode.WithAdditionalAnnotations(annotation1); 594var newNode = nodeOrToken.AsNode().WithAdditionalAnnotations(annotation); 729return base.Visit(node).WithAdditionalAnnotations(_annotation); 778return base.Visit(node).WithAdditionalAnnotations(annotation);
Syntax\SyntaxNodeTests.cs (1)
494var exprWithAnnotations = expr.ReplaceNodes(identifierNodes, (e, e2) => e2.WithAdditionalAnnotations(myAnnotation));
Microsoft.CodeAnalysis.CSharp.Workspaces (47)
CodeGeneration\CSharpSyntaxGenerator.cs (5)
3138=> SyntaxFactory.Block(AsStatementList(statements)).WithAdditionalAnnotations(Simplifier.Annotation); 3243=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 3293=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 3296=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 3423=> SyntaxFactory.QualifiedName((NameSyntax)left, (SimpleNameSyntax)right).WithAdditionalAnnotations(Simplifier.Annotation);
Rename\CSharpRenameRewriterLanguageService.cs (1)
290newNode = newNode.WithAdditionalAnnotations(annotation);
Simplification\CSharpSimplificationService.Expander.cs (12)
188var newParameter = parameters[i].WithType(typeSyntax).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); 659.WithAdditionalAnnotations(Simplifier.Annotation); 713var result = newNode.WithAdditionalAnnotations(Simplifier.Annotation); 979result = rewrittenNode.CopyAnnotationsTo(QualifiedName((NameSyntax)left, right.WithAdditionalAnnotations(Simplifier.SpecialTypeAnnotation))); 1112newMemberAccess = originalNode.Expression.CopyAnnotationsTo(newMemberAccess).WithAdditionalAnnotations(Simplifier.Annotation); 1126.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (1)
57return node.WithAdditionalAnnotations(SimplificationHelpers.DoNotSimplifyAnnotation);
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (1)
65.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
46var newParameterSyntax = parameterSyntax.WithType(null).WithAdditionalAnnotations(annotation);
Simplification\Reducers\CSharpNameReducer.cs (1)
61node = node.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Formatter.Annotation);
Simplification\Reducers\CSharpNameReducer.Rewriter.cs (1)
223return result.Parenthesize().WithAdditionalAnnotations(Formatter.Annotation);
Simplification\Simplifiers\ExpressionSimplifier.cs (3)
186.WithAdditionalAnnotations<TypeSyntax>(new SyntaxAnnotation( 293.WithAdditionalAnnotations(Simplifier.Annotation); 304.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\Simplifiers\NameSimplifier.cs (1)
478replacementNode = replacementNode.WithAdditionalAnnotations(new SyntaxAnnotation(codeStyleOptionName));
Simplification\Simplifiers\QualifiedCrefSimplifier.cs (1)
54.WithAdditionalAnnotations(new SyntaxAnnotation(nameof(CodeStyleOptions2.PreferIntrinsicPredefinedTypeKeywordInMemberAccess)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
199SyntaxFactory.IdentifierName("var").WithTriviaFrom(declarationTypeNode).WithAdditionalAnnotations(annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
32? result.WithAdditionalAnnotations(Formatter.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (3)
290memberAccess = memberAccess.WithAdditionalAnnotations(SpecialTypeAnnotation.Create(type.SpecialType)); 294return result.WithAdditionalAnnotations(Simplifier.Annotation); 317result = result.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\BaseNamespaceDeclarationSyntaxExtensions.cs (1)
27newUsings = newUsings.Select(u => u.WithAdditionalAnnotations(annotations)).ToList();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CastExpressionSyntaxExtensions.cs (1)
31.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
137[.. usings.Select(u => u.WithAdditionalAnnotations(annotations))]);
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 (3)
28=> typeSymbol.Accept(ExpressionSyntaxGeneratorVisitor.Create(nameSyntax))!.WithAdditionalAnnotations(Simplifier.Annotation); 52.WithAdditionalAnnotations(Simplifier.Annotation); 55syntax = syntax.WithAdditionalAnnotations(DoNotAllowVarAnnotation.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
36syntax = syntax.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
42syntax = syntax.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
230.WithAdditionalAnnotations(Formatter.Annotation); 251.WithAdditionalAnnotations(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (1)
65return node.WithAdditionalAnnotations(s_annotation);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\AddImportsTests.cs (1)
52? c.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol), Simplifier.Annotation)
Formatting\FormattingElasticTriviaTests.cs (1)
112var newDecl = generator.AddAttributes(decl, generator.Attribute("Some")).WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
613updatedDeclarationNode = updatedDeclarationNode.WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Simplification\AbstractSimplificationTests.vb (1)
106root = root.ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation))
Simplification\ParameterSimplificationTests.vb (1)
27(Await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.Features (70)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
152.WithAdditionalAnnotations(
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (1)
72var updatedRoot = newRoot.WithAdditionalAnnotations(SuppressDiagnosticsAnnotation.Create());
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (1)
62var newNamespaceDeclaration = syntaxGenerator.NamespaceDeclaration(name, WithElasticTrivia(typeToMove)).WithAdditionalAnnotations(NamespaceScopeMovedAnnotation);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (3)
316documentEditor.ReplaceNode(container, container.WithAdditionalAnnotations(ContainerAnnotation)); 415import = import.WithAdditionalAnnotations(Formatter.Annotation); 731editor.ReplaceNode(oldNode, newNode.WithAdditionalAnnotations(Simplifier.Annotation));
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
111document = document.WithSyntaxRoot(newRoot.ReplaceNode(declaration, declaration.WithAdditionalAnnotations(_annotation)));
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
243return syntaxGenerator.NamespaceImportDeclaration(namespaceName).WithAdditionalAnnotations(Formatter.Annotation);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
238.WithAdditionalAnnotations(Formatter.Annotation);
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
133return ConvertToTuple(anonCreation).WithAdditionalAnnotations(Formatter.Annotation);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
99editor.ReplaceNode(property, fullProperty.WithAdditionalAnnotations(Formatter.Annotation));
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (2)
100return foreachCollectionExpression.WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation); 146return (TStatementSyntax)localDecl.WithAdditionalAnnotations(Formatter.Annotation);
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
451(node, _) => node.WithAdditionalAnnotations(
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
50.WithAdditionalAnnotations(Formatter.Annotation) 51.WithAdditionalAnnotations(Simplifier.Annotation);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
203? converted.WithAdditionalAnnotations(Simplifier.Annotation)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
713.WithAdditionalAnnotations(Formatter.Annotation);
EncapsulateField\AbstractEncapsulateFieldService.cs (3)
179fieldDeclaration.GetSyntax(cancellationToken).WithAdditionalAnnotations(declarationAnnotation))); 387assigned.WithAdditionalAnnotations(Simplifier.Annotation), 405value.WithAdditionalAnnotations(Simplifier.Annotation));
ExtractInterface\AbstractExtractInterfaceService.cs (1)
348var unformattedTypeDeclaration = syntaxGenerator.AddInterfaceType(typeDeclaration, typeReference).WithAdditionalAnnotations(Formatter.Annotation);
ExtractMethod\MethodExtractor.CodeGenerator.cs (2)
259declarationStatement = declarationStatement.WithAdditionalAnnotations(CallSiteAnnotation); 266CreateAssignmentExpressionStatement(CreateIdentifier(variable.Name), CreateCallSignature()).WithAdditionalAnnotations(CallSiteAnnotation));
ExtractMethod\SelectionResult.cs (1)
231return root.ReplaceNodes(tokenMap.Keys, (o, n) => o.WithAdditionalAnnotations(tokenMap[o]));
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
517updatedExpression.WithAdditionalAnnotations(Formatter.Annotation), parameterName, insertionIndex, named);
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (3)
145newParent.WithAdditionalAnnotations(Formatter.Annotation))); 174newParent.WithAdditionalAnnotations(Formatter.Annotation))); 183usingStatement.WithAdditionalAnnotations(Formatter.Annotation)));
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
392.WithAdditionalAnnotations(Formatter.Annotation);
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (5)
510return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 534return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 560return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 583return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 608return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation));
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (3)
297.WithAdditionalAnnotations(Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType))); 324.WithAdditionalAnnotations(Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType))); 336.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType)),
PullMemberUp\MembersPuller.cs (2)
307.WithAdditionalAnnotations(s_destinationNodeAnnotation); 337.WithAdditionalAnnotations(s_removableImportAnnotation)));
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
260editor.ReplaceNode(nameToken.Parent, nameToken.Parent.WithAdditionalAnnotations( 300editor.ReplaceNode(nameToken.Parent, nameToken.Parent.WithAdditionalAnnotations(
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
329.WithAdditionalAnnotations(Simplifier.Annotation);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (3)
270editor.ReplaceNode(parent, parent.WithAdditionalAnnotations( 275editor.ReplaceNode(parent, parent.WithAdditionalAnnotations( 280editor.ReplaceNode(parent, parent.WithAdditionalAnnotations(
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
61currentRoots[typeNode.SyntaxTree] = typeNodeRoot.ReplaceNode(typeNode, typeNode.WithAdditionalAnnotations(typeNodeAnnotation));
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);
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
67leftCondition = leftCondition.WithAdditionalAnnotations(Formatter.Annotation); 68rightCondition = rightCondition.WithAdditionalAnnotations(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\AddParameter\AddParameterService.cs (2)
125.WithAdditionalAnnotations(Formatter.Annotation); 128parameterDeclaration = parameterDeclaration.WithAdditionalAnnotations(
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121var newRoot = root.ReplaceNode(docCommentNode, newDocComment.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (1)
79rewritten = rewritten.WithAdditionalAnnotations(
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
93.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
104.WithAdditionalAnnotations(Formatter.Annotation, annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (2)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation) 199.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
38switchNode, switchExpression).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
39switchNode, switchOperation).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (5)
419.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 434.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 589declarationStatement = declarationStatement.WithAdditionalAnnotations(s_unusedLocalDeclarationAnnotation); 641nodeReplacementMap.Add(localDeclarationStatement, localDeclarationStatement.WithAdditionalAnnotations(s_existingLocalDeclarationWithoutInitializerAnnotation)); 690.WithAdditionalAnnotations(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
112conditionalExpression = conditionalExpression.WithAdditionalAnnotations(Simplifier.Annotation); 118conditionalExpression = conditionalExpression.WithAdditionalAnnotations(
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
80.WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.UnitTests (1)
CommonSyntaxTests.cs (1)
240computeReplacementNode: (node, rewritten) => CSharp.SyntaxFactory.ParenthesizedExpression(rewritten).WithAdditionalAnnotations(annotation));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (4)
628SyntaxFactory.EndSubStatement()).WithAdditionalAnnotations(annotations) 699.WithAdditionalAnnotations(annotations) 708.WithAdditionalAnnotations(annotations) 739SyntaxFactory.EndSubStatement()).WithAdditionalAnnotations(annotations)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
43Return node.WithAdditionalAnnotations(_annotation)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (22)
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (2)
100.WithAdditionalAnnotations(Formatter.Annotation) 105.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\ConvertTypeOfToNameOf\VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
43WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
42Dim yieldStatement = SyntaxFactory.YieldStatement(returnStatement.Expression).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
107Dim newCastExpression = Uncast(castExpression).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedValuesCodeFixProvider.vb (1)
71Return proposedReplacementNode.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
69Dim result = newStatement.WithLeadingTrivia(totalTrivia).WithAdditionalAnnotations(Formatter.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\ParameterSyntaxExtensions.vb (1)
19Dim newParameterSyntax = parameter.WithAsClause(Nothing).WithAdditionalAnnotations(annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (1)
92Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (3)
94Return SyntaxFactory.EndClassStatement().WithAdditionalAnnotations(Formatter.Annotation) 96Return SyntaxFactory.EndInterfaceStatement().WithAdditionalAnnotations(Formatter.Annotation) 98Return SyntaxFactory.EndStructureStatement().WithAdditionalAnnotations(Formatter.Annotation)
Microsoft.CodeAnalysis.VisualBasic.Features (39)
AddImport\VisualBasicAddImportFeatureService.vb (1)
208nameSyntax = nameSyntax.WithAdditionalAnnotations(Simplifier.Annotation)
ChangeSignature\UnifiedArgumentSyntax.vb (1)
52Return New UnifiedArgumentSyntax(_argument.WithAdditionalAnnotations(annotation))
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (3)
195Dim updatedDocument = Await document.ReplaceNodeAsync(node, updatedProperty.WithAdditionalAnnotations(Formatter.Annotation), cancellationToken).ConfigureAwait(False) 222Dim updatedDocument = Await document.ReplaceNodeAsync(endStatement.Parent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation), cancellationToken).ConfigureAwait(False) 257updatedDocument = Await updatedDocument.ReplaceNodeAsync(tree, tree.WithAdditionalAnnotations(Formatter.Annotation), cancellationToken).ConfigureAwait(False)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (2)
206.WithAdditionalAnnotations(Formatter.Annotation) 225.WithAdditionalAnnotations(Formatter.Annotation)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (1)
79Return newNode.WithAdditionalAnnotations(Formatter.Annotation)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (1)
128Dim attributeName = DirectCast(suppressMessageAttribute.GenerateTypeSyntax(), NameSyntax).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (6)
123Dim updatedDocument = Await document.ReplaceNodeAsync(modifiedIdentifier, modifiedIdentifier.WithAdditionalAnnotations(s_definitionAnnotation), cancellationToken).ConfigureAwait(False) 196updatedDocument = Await updatedDocument.ReplaceNodeAsync(scope, newScope.WithAdditionalAnnotations(Formatter.Annotation), cancellationToken).ConfigureAwait(False) 282.WithAdditionalAnnotations(Formatter.Annotation) 360.WithAdditionalAnnotations(Simplifier.Annotation) 375.WithAdditionalAnnotations(s_initializerAnnotation) 466.WithAdditionalAnnotations(ConflictAnnotation.Create(VBFeaturesResources.Conflict_s_detected))
EncapsulateField\VisualBasicEncapsulateFieldService.vb (1)
61.WithAdditionalAnnotations(Formatter.Annotation)
ExtractInterface\VisualBasicExtractInterfaceService.vb (2)
75Return implementsClause.AddInterfaceMembers(qualifiedName).WithAdditionalAnnotations(Formatter.Annotation) 77Return SyntaxFactory.ImplementsClause(qualifiedName).WithAdditionalAnnotations(Formatter.Annotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.CallSiteContainerRewriter.vb (1)
95Return node.WithAdditionalAnnotations(s_removeAnnotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.ExpressionCodeGenerator.vb (1)
120.WithAdditionalAnnotations(enclosingStatementAnnotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (2)
99Return container.CopyAnnotationsTo(callSiteGenerator.Generate()).WithAdditionalAnnotations(Formatter.Annotation) 329Dim methodName As ExpressionSyntax = CreateMethodNameForInvocation().WithAdditionalAnnotations(Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService.Rewriter.vb (2)
29.WithAdditionalAnnotations(_replacementAnnotation) 41Return newNode.WithAdditionalAnnotations(Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (1)
34name:=SyntaxFactory.IdentifierName(newNameToken)).WithAdditionalAnnotations(Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceLocal.vb (2)
93SyntaxFactory.EndFunctionStatement()).WithAdditionalAnnotations(Formatter.Annotation) 126declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation, localAnnotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceQueryLocal.vb (1)
30expression)).WithAdditionalAnnotations(Formatter.Annotation)
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (1)
129Return newPropertyDeclaration.WithAdditionalAnnotations(Formatter.Annotation)
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (1)
109Return statement.WithAdditionalAnnotations(Formatter.Annotation)
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.vb (1)
42Return expression.WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (2)
100.WithAdditionalAnnotations(Formatter.Annotation) 105.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\ConvertTypeOfToNameOf\VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
43WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
42Dim yieldStatement = SyntaxFactory.YieldStatement(returnStatement.Expression).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
107Dim newCastExpression = Uncast(castExpression).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedValuesCodeFixProvider.vb (1)
71Return proposedReplacementNode.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
69Dim result = newStatement.WithLeadingTrivia(totalTrivia).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52Return statement.ReplaceNode(declarator, declarator.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (6)
Syntax\SyntaxAnnotationTests.vb (6)
150Dim annotatedNode = node.WithAdditionalAnnotations(annotation1) 160Dim twiceAnnotatedNode = node2.WithAdditionalAnnotations(annotation2) 270Dim annotatedNode = lastChildOfFirstNode.WithAdditionalAnnotations(annotation1) 539Dim newNode = nodeOrToken.AsNode().WithAdditionalAnnotations(annotation) 677Return MyBase.Visit(node).WithAdditionalAnnotations(_annotation) 718Return MyBase.Visit(node).WithAdditionalAnnotations(annotation)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (49)
CodeGeneration\VisualBasicSyntaxGenerator.vb (3)
140Return SyntaxFactory.DirectCastExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation) 144Return SyntaxFactory.CTypeExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation) 194SyntaxFactory.SeparatedList(typeArguments.Cast(Of TypeSyntax)()))).WithAdditionalAnnotations(Simplifier.Annotation)
Rename\VisualBasicRenameRewriterLanguageService.vb (2)
189newNode = newNode.WithAdditionalAnnotations(annotation) 211expandedNewNode = expandedNewNode.WithAdditionalAnnotations(annotationForSpeculativeNode)
Simplification\Reducers\VisualBasicNameReducer.vb (1)
48node = node.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Formatter.Annotation)
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
45replacementNode = node.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Formatter.Annotation)
Simplification\Simplifiers\ExpressionSimplifier.vb (2)
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)
Simplification\Simplifiers\NameSimplifier.vb (1)
186replacementNode = replacementNode.WithAdditionalAnnotations(New SyntaxAnnotation(codeStyleOptionName))
Simplification\VisualBasicSimplificationService.Expander.vb (19)
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) 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) 776result = rewrittenNode.CopyAnnotationsTo(SyntaxFactory.QualifiedName(DirectCast(left, NameSyntax), right.WithAdditionalAnnotations(Simplifier.SpecialTypeAnnotation)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (4)
628SyntaxFactory.EndSubStatement()).WithAdditionalAnnotations(annotations) 699.WithAdditionalAnnotations(annotations) 708.WithAdditionalAnnotations(annotations) 739SyntaxFactory.EndSubStatement()).WithAdditionalAnnotations(annotations)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
43Return node.WithAdditionalAnnotations(_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\ParameterSyntaxExtensions.vb (1)
19Dim newParameterSyntax = parameter.WithAsClause(Nothing).WithAdditionalAnnotations(annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (1)
92Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (3)
94Return SyntaxFactory.EndClassStatement().WithAdditionalAnnotations(Formatter.Annotation) 96Return SyntaxFactory.EndInterfaceStatement().WithAdditionalAnnotations(Formatter.Annotation) 98Return SyntaxFactory.EndStructureStatement().WithAdditionalAnnotations(Formatter.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (1)
44newRoot = newRoot.WithAdditionalAnnotations(Formatter.Annotation)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (4)
Formatting\FormattingTests.vb (4)
3777root = root.ReplaceNode(implementsStatement, implementsStatement.NormalizeWhitespace(elasticTrivia:=True).WithAdditionalAnnotations(goo)) 3780root = root.ReplaceNode(field, field.NormalizeWhitespace(elasticTrivia:=True).WithAdditionalAnnotations(goo)) 3782root = root.ReplaceNode(prop, prop.NormalizeWhitespace(elasticTrivia:=True).WithAdditionalAnnotations(goo)) 3785root = root.ReplaceNode(method, method.NormalizeWhitespace(elasticTrivia:=True).WithAdditionalAnnotations(goo))
Microsoft.CodeAnalysis.Workspaces (35)
Editing\SyntaxGenerator.cs (3)
1910name = QualifiedName(name, IdentifierName(part)).WithAdditionalAnnotations(Simplifier.Annotation); 1945: expression.WithAdditionalAnnotations(DoNotAddImportsAnnotation.Annotation); 2170.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
212var annotatedExpression = _newExpressionForReplace.WithAdditionalAnnotations(annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (1)
76=> node.WithAdditionalAnnotations(this.GetOrCreateRealAnnotations(annotations).ToArray());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
73? node.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
40? syntax?.WithAdditionalAnnotations(codeGenerationSymbol.GetAnnotations()) 44=> node.WithAdditionalAnnotations(Formatter.Annotation, CodeGenerator.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
46.WithAdditionalAnnotations(Formatter.Annotation); 73.WithAdditionalAnnotations(Formatter.Annotation)); 96.WithAdditionalAnnotations(Formatter.Annotation)); 117.WithAdditionalAnnotations(Formatter.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 (5)
159through.WithAdditionalAnnotations(Simplifier.Annotation)); 174through = through.WithAdditionalAnnotations(Simplifier.Annotation); 178return through.WithAdditionalAnnotations(Simplifier.Annotation); 352.WithAdditionalAnnotations(Simplifier.Annotation); 425factory.IdentifierName(parameter.Name))).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (4)
44statements = statements.SelectAsArray(s => s.WithAdditionalAnnotations(statementAnnotation)); 75statements = statements.SelectAsArray(s => s.WithAdditionalAnnotations(statementAnnotation)); 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\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (6)
127: explicitDeclarationStatement.WithAdditionalAnnotations(warningAnnotation); 128declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); 142newNextStatement.WithAdditionalAnnotations(Formatter.Annotation).WithLeadingTrivia( 152(current, generator) => current.WithAdditionalAnnotations(Formatter.Annotation).WithPrependedLeadingTrivia( 164: declarationStatement.WithAdditionalAnnotations(warningAnnotation); 172declarationStatement.WithAdditionalAnnotations(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
256var newRoot = root.ReplaceNode(nodeOrToken.AsNode()!, currentNode.WithAdditionalAnnotations(marker)); 305(o, r) => r.WithAdditionalAnnotations(removeIfUnusedAnnotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (1)
35to = to.WithAdditionalAnnotations(DoNotSimplifyAnnotation);
Microsoft.CodeAnalysis.Workspaces.UnitTests (7)
CodeCleanup\CodeCleanupTests.cs (2)
135document = document.WithSyntaxRoot((await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(annotation)); 148document = document.WithSyntaxRoot((await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(annotation));
SolutionTests\SolutionTests.cs (4)
3191var annotatedRoot = root.WithAdditionalAnnotations(annotation); 3433tree = tree.WithAdditionalAnnotations(new SyntaxAnnotation("test")); 3693var newRoot = doc.GetSyntaxRootAsync().Result.WithAdditionalAnnotations(SyntaxAnnotation.ElasticAnnotation); 5437var newRoot = root.WithAdditionalAnnotations(new SyntaxAnnotation());
WorkspaceTests\AdhocWorkspaceTests.cs (1)
345var newRoot = root.WithAdditionalAnnotations(new SyntaxAnnotation());
Microsoft.Interop.ComInterfaceGenerator (3)
Analyzers\AddGeneratedComClassFixer.cs (1)
28var attribute = gen.Attribute(gen.TypeExpression(editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.GeneratedComClassAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation));
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (2)
78var generatedComInterfaceAttribute = gen.Attribute(gen.TypeExpression(comp.GetTypeByMetadataName(TypeNames.GeneratedComInterfaceAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)); 93generatedComInterfaceAttribute = generatedComInterfaceAttribute.WithAdditionalAnnotations(
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportFixer.cs (2)
186generatedDeclaration = generatedDeclaration.WithAdditionalAnnotations(WarningAnnotation.Create(SR.ConvertNoPreserveSigDllImportToGeneratedMayProduceInvalidCode)); 231libraryImportSyntax = libraryImportSyntax.WithAdditionalAnnotations(
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\CSharpSnippetExpansionLanguageHelper.cs (1)
150newUsings.Add(candidateUsing.WithAdditionalAnnotations(Formatter.Annotation).WithAppendedTrailingTrivia(SyntaxFactory.CarriageReturnLineFeed));
Microsoft.VisualStudio.LanguageServices.VisualBasic (6)
CodeModel\VisualBasicCodeModelService.vb (5)
1331Dim newDeclarator = declarator.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1344Dim newDeclaration = declaration.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1372Dim newArgumentList = argumentList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1379Dim newParameterList = parameterList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 3939.WithAdditionalAnnotations(Formatter.Annotation)
Snippets\VisualBasicSnippetExpansionLanguageHelper.vb (1)
160importsToAdd.Add(filteredImportsStatement.WithAdditionalAnnotations(Formatter.Annotation) _
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (1)
144.WithAdditionalAnnotations(Formatter.Annotation);
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (2)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (2)
155WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation) 160WithAdditionalAnnotations(Formatter.Annotation)