512 references to WithAdditionalAnnotations
IdeCoreBenchmarks (1)
FormatterBenchmarks.cs (1)
54
var 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)
75
root.ReplaceNode(diagnosticTarget, invocation.
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation, annotation))));
RouteParameterUnusedParameterFixer.cs (1)
88
var 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)
53
return 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)
212
var 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)
131
return (currentTarget.Parent, currentTarget.Parent.ReplaceNode(currentTarget, currentReplacement).
WithAdditionalAnnotations
(Simplifier.Annotation));
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
125
.
WithAdditionalAnnotations
(Formatter.Annotation);
128
parameterDeclaration = parameterDeclaration.
WithAdditionalAnnotations
(
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121
var 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)
181
let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).
WithAdditionalAnnotations
(Simplifier.Annotation)
199
.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
38
switchNode, switchExpression).
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
39
switchNode, switchOperation).
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (6)
281
root = root.ReplaceNodes(memberDeclarations, computeReplacementNode: (_, n) => n.
WithAdditionalAnnotations
(s_memberAnnotation));
419
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
434
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
589
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(s_unusedLocalDeclarationAnnotation);
641
nodeReplacementMap.Add(localDeclarationStatement, localDeclarationStatement.
WithAdditionalAnnotations
(s_existingLocalDeclarationWithoutInitializerAnnotation));
690
.
WithAdditionalAnnotations
(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
112
conditionalExpression = conditionalExpression.
WithAdditionalAnnotations
(Simplifier.Annotation);
118
conditionalExpression = 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)
159
through.
WithAdditionalAnnotations
(Simplifier.Annotation));
174
through = through.
WithAdditionalAnnotations
(Simplifier.Annotation);
178
return through.
WithAdditionalAnnotations
(Simplifier.Annotation);
352
.
WithAdditionalAnnotations
(Simplifier.Annotation);
425
factory.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)
226
factory.IdentifierName(member.Name)).
WithAdditionalAnnotations
(Simplification.Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (6)
127
: explicitDeclarationStatement.
WithAdditionalAnnotations
(warningAnnotation);
128
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
142
newNextStatement.
WithAdditionalAnnotations
(Formatter.Annotation).WithLeadingTrivia(
152
(current, generator) => current.
WithAdditionalAnnotations
(Formatter.Annotation).WithPrependedLeadingTrivia(
164
: declarationStatement.
WithAdditionalAnnotations
(warningAnnotation);
172
declarationStatement.
WithAdditionalAnnotations
(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
256
var newRoot = root.ReplaceNode(nodeOrToken.AsNode()!, currentNode.
WithAdditionalAnnotations
(marker));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (1)
35
to = to.
WithAdditionalAnnotations
(DoNotSimplifyAnnotation);
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
58
ConstantPattern(ParenthesizedExpression(binaryExpression.Right.
WithAdditionalAnnotations
(s_annotation)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
199
SyntaxFactory.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)
87
converted.
WithAdditionalAnnotations
(annotation));
295
(_, _) => converted.
WithAdditionalAnnotations
(annotation),
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
269
node.Expression.Cast(expressionConvertedType).
WithAdditionalAnnotations
(Formatter.Annotation),
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
153
SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), newNameNode).
WithAdditionalAnnotations
(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
122
fixedDeclaration = fixedDeclaration.
WithAdditionalAnnotations
(Simplifier.Annotation).WithTriviaFrom(declarationTypeToFix);
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
305
newType = newType.WithoutTrivia().
WithAdditionalAnnotations
(Formatter.Annotation);
365
.
WithAdditionalAnnotations
(annotation));
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
108
newStatement = newStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
148
newStatement = newStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
77
.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
193
localFunctionWithNewParameters = localFunctionWithNewParameters.
WithAdditionalAnnotations
(annotation);
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (2)
116
var newReturnType = returnTypeSyntax.
WithAdditionalAnnotations
(Formatter.Annotation);
152
return 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);
73
return 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)
166
return 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)
33
return newCreation.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
42
statement.Declaration.Type.
WithAdditionalAnnotations
(Simplifier.Annotation)));
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
71
editor.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)
88
var 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)
129
return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).
WithAdditionalAnnotations
(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
95
return newIf.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
155
a => 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)
294
return result.
WithAdditionalAnnotations
(Simplifier.Annotation);
317
result = result.
WithAdditionalAnnotations
(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\BaseNamespaceDeclarationSyntaxExtensions.cs (1)
27
newUsings = 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)
94
return 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)
65
return 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)
183
currentNode = currentNode.
WithAdditionalAnnotations
(Simplifier.Annotation);
241
newNode = newNode.
WithAdditionalAnnotations
(Simplifier.Annotation);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (3)
144
document = await document.ReplaceNodeAsync(declarator, declarator.
WithAdditionalAnnotations
(DefinitionAnnotation), cancellationToken).ConfigureAwait(false);
310
newLocalDeclaration.
WithAdditionalAnnotations
(Formatter.Annotation));
379
expressionToInline = expressionToInline.
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
101
.
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (1)
185
SyntaxFactory.IdentifierName(MethodName))).
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\YieldReturnConverter.cs (1)
38
SyntaxFactory.ReturnStatement(queryOrLinqInvocationExpression).
WithAdditionalAnnotations
(Formatter.Annotation));
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (10)
119
return Block(IfStatement(((WhereClauseSyntax)node).Condition.
WithAdditionalAnnotations
(Simplifier.Annotation).WithoutTrivia(), statement));
441
nodesBeforeLocal = [parentStatement.ReplaceNode(invocationExpression, initializer.
WithAdditionalAnnotations
(Simplifier.Annotation))];
454
nodesAfterLocal = [parentStatement.ReplaceNode(invocationExpression, variableLocal.
WithAdditionalAnnotations
(Simplifier.Annotation))];
503
nodesAfter = new[] { ReturnStatement(variable).
WithAdditionalAnnotations
(Simplifier.Annotation) };
530
EqualsValueClause(expression))])).
WithAdditionalAnnotations
(Simplifier.Annotation);
598
var localFunctionInvocation = InvocationExpression(IdentifierName(localFunctionToken)).
WithAdditionalAnnotations
(Simplifier.Annotation);
599
var newParentExpressionStatement = parentStatement.ReplaceNode(_source.WalkUpParentheses(), localFunctionInvocation.
WithAdditionalAnnotations
(Simplifier.Annotation));
701
forEachStatement.Statement).
WithAdditionalAnnotations
(Formatter.Annotation), queryExpressionProcessingInfo);
723
expression => forEachStatement.Statement.
WithAdditionalAnnotations
(Formatter.Annotation),
829
statements.Add(statement.
WithAdditionalAnnotations
(Simplifier.Annotation));
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
314
var constructorDeclaration = CreateConstructorDeclaration().
WithAdditionalAnnotations
(constructorAnnotation);
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
90
method = method.WithReturnType(method.ReturnType.
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation));
131
var statement = globalStatement.Statement.
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (2)
94
directives.Add(UsingDirective(name).
WithAdditionalAnnotations
(annotation));
232
globalStatements.Add(GlobalStatement(statement).
WithAdditionalAnnotations
(Formatter.Annotation));
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
60
var updatedDeclarator = declarator.WithIdentifier(newIdentifier).
WithAdditionalAnnotations
(tempAnnotation);
77
.
WithAdditionalAnnotations
(Formatter.Annotation)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
140
return container.CopyAnnotationsTo(callSiteGenerator.Generate()).
WithAdditionalAnnotations
(Formatter.Annotation);
570
var methodName = CreateMethodNameForInvocation().
WithAdditionalAnnotations
(Simplifier.Annotation);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
167
.
WithAdditionalAnnotations
(enclosingStatementAnnotation);
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
212
declarationStatement = 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);
50
return newNode.
WithAdditionalAnnotations
(Simplifier.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
53
EqualsValueClause(expression.WithoutTrivia()))])).
WithAdditionalAnnotations
(Formatter.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (4)
113
.
WithAdditionalAnnotations
(Formatter.Annotation);
245
.
WithAdditionalAnnotations
(Formatter.Annotation);
295
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
332
Block(root.GetCurrentNode(statement)).
WithAdditionalAnnotations
(Formatter.Annotation));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (1)
38
expression).
WithAdditionalAnnotations
(Formatter.Annotation);
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
177
: updatedIf.
WithAdditionalAnnotations
(Formatter.Annotation);
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (5)
155
return property.
WithAdditionalAnnotations
(Formatter.Annotation);
189
.
WithAdditionalAnnotations
(Formatter.Annotation);
202
.
WithAdditionalAnnotations
(Formatter.Annotation);
228
return accessor.WithBody(getMethodDeclaration.Body.
WithAdditionalAnnotations
(Formatter.Annotation));
277
return accessor.WithBody(body.
WithAdditionalAnnotations
(Formatter.Annotation));
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (2)
142
.
WithAdditionalAnnotations
(Formatter.Annotation);
213
.
WithAdditionalAnnotations
(Formatter.Annotation);
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
356
return expr.
WithAdditionalAnnotations
(Formatter.Annotation);
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.cs (2)
54
var annotatedexpressionSyntax = expressionSyntax.
WithAdditionalAnnotations
(
60
annotatedexpressionSyntax = annotatedexpressionSyntax.ReplaceNode(right, right.
WithAdditionalAnnotations
(Simplifier.Annotation));
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
58
ConstantPattern(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)
87
converted.
WithAdditionalAnnotations
(annotation));
295
(_, _) => converted.
WithAdditionalAnnotations
(annotation),
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
153
SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), newNameNode).
WithAdditionalAnnotations
(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
122
fixedDeclaration = fixedDeclaration.
WithAdditionalAnnotations
(Simplifier.Annotation).WithTriviaFrom(declarationTypeToFix);
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
305
newType = newType.WithoutTrivia().
WithAdditionalAnnotations
(Formatter.Annotation);
365
.
WithAdditionalAnnotations
(annotation));
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
108
newStatement = newStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
148
newStatement = newStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
77
.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
193
localFunctionWithNewParameters = localFunctionWithNewParameters.
WithAdditionalAnnotations
(annotation);
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (2)
116
var newReturnType = returnTypeSyntax.
WithAdditionalAnnotations
(Formatter.Annotation);
152
return 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)
166
return 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)
33
return newCreation.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
42
statement.Declaration.Type.
WithAdditionalAnnotations
(Simplifier.Annotation)));
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (2)
71
editor.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)
88
var 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)
129
return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).
WithAdditionalAnnotations
(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
95
return newIf.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
155
a => 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)
164
var annotatedNode = node.
WithAdditionalAnnotations
(annotation1);
174
var twiceAnnotatedNode = node2.
WithAdditionalAnnotations
(annotation2);
288
var annotatedNode = lastChildOfFirstNode.
WithAdditionalAnnotations
(annotation1);
594
var newNode = nodeOrToken.AsNode().
WithAdditionalAnnotations
(annotation);
729
return base.Visit(node).
WithAdditionalAnnotations
(_annotation);
778
return base.Visit(node).
WithAdditionalAnnotations
(annotation);
Syntax\SyntaxNodeTests.cs (1)
494
var 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)
290
newNode = newNode.
WithAdditionalAnnotations
(annotation);
Simplification\CSharpSimplificationService.Expander.cs (12)
188
var 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);
713
var result = newNode.
WithAdditionalAnnotations
(Simplifier.Annotation);
979
result = rewrittenNode.CopyAnnotationsTo(QualifiedName((NameSyntax)left, right.
WithAdditionalAnnotations
(Simplifier.SpecialTypeAnnotation)));
1112
newMemberAccess = originalNode.Expression.CopyAnnotationsTo(newMemberAccess).
WithAdditionalAnnotations
(Simplifier.Annotation);
1126
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (1)
57
return node.
WithAdditionalAnnotations
(SimplificationHelpers.DoNotSimplifyAnnotation);
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (1)
65
.
WithAdditionalAnnotations
(Simplifier.Annotation);
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
46
var newParameterSyntax = parameterSyntax.WithType(null).
WithAdditionalAnnotations
(annotation);
Simplification\Reducers\CSharpNameReducer.cs (1)
61
node = node.CopyAnnotationsTo(replacementNode).
WithAdditionalAnnotations
(Formatter.Annotation);
Simplification\Reducers\CSharpNameReducer.Rewriter.cs (1)
223
return 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)
478
replacementNode = 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)
199
SyntaxFactory.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)
290
memberAccess = memberAccess.
WithAdditionalAnnotations
(SpecialTypeAnnotation.Create(type.SpecialType));
294
return result.
WithAdditionalAnnotations
(Simplifier.Annotation);
317
result = result.
WithAdditionalAnnotations
(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\BaseNamespaceDeclarationSyntaxExtensions.cs (1)
27
newUsings = 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)
94
return 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);
55
syntax = syntax.
WithAdditionalAnnotations
(DoNotAllowVarAnnotation.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
36
syntax = syntax.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
42
syntax = 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)
65
return 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)
112
var newDecl = generator.AddAttributes(decl, generator.Attribute("Some")).
WithAdditionalAnnotations
(Formatter.Annotation);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
613
updatedDeclarationNode = updatedDeclarationNode.
WithAdditionalAnnotations
(Formatter.Annotation);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Simplification\AbstractSimplificationTests.vb (1)
106
root = 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)
72
var updatedRoot = newRoot.
WithAdditionalAnnotations
(SuppressDiagnosticsAnnotation.Create());
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (1)
62
var newNamespaceDeclaration = syntaxGenerator.NamespaceDeclaration(name, WithElasticTrivia(typeToMove)).
WithAdditionalAnnotations
(NamespaceScopeMovedAnnotation);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (3)
316
documentEditor.ReplaceNode(container, container.
WithAdditionalAnnotations
(ContainerAnnotation));
415
import = import.
WithAdditionalAnnotations
(Formatter.Annotation);
731
editor.ReplaceNode(oldNode, newNode.
WithAdditionalAnnotations
(Simplifier.Annotation));
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
111
document = document.WithSyntaxRoot(newRoot.ReplaceNode(declaration, declaration.
WithAdditionalAnnotations
(_annotation)));
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
243
return syntaxGenerator.NamespaceImportDeclaration(namespaceName).
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
238
.
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
133
return ConvertToTuple(anonCreation).
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
99
editor.ReplaceNode(property, fullProperty.
WithAdditionalAnnotations
(Formatter.Annotation));
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (2)
100
return foreachCollectionExpression.WithoutTrivia().
WithAdditionalAnnotations
(Formatter.Annotation);
146
return (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)
179
fieldDeclaration.GetSyntax(cancellationToken).
WithAdditionalAnnotations
(declarationAnnotation)));
387
assigned.
WithAdditionalAnnotations
(Simplifier.Annotation),
405
value.
WithAdditionalAnnotations
(Simplifier.Annotation));
ExtractInterface\AbstractExtractInterfaceService.cs (1)
348
var unformattedTypeDeclaration = syntaxGenerator.AddInterfaceType(typeDeclaration, typeReference).
WithAdditionalAnnotations
(Formatter.Annotation);
ExtractMethod\MethodExtractor.CodeGenerator.cs (2)
259
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(CallSiteAnnotation);
266
CreateAssignmentExpressionStatement(CreateIdentifier(variable.Name), CreateCallSignature()).
WithAdditionalAnnotations
(CallSiteAnnotation));
ExtractMethod\SelectionResult.cs (1)
231
return root.ReplaceNodes(tokenMap.Keys, (o, n) => o.
WithAdditionalAnnotations
(tokenMap[o]));
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
517
updatedExpression.
WithAdditionalAnnotations
(Formatter.Annotation), parameterName, insertionIndex, named);
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (3)
145
newParent.
WithAdditionalAnnotations
(Formatter.Annotation)));
174
newParent.
WithAdditionalAnnotations
(Formatter.Annotation)));
183
usingStatement.
WithAdditionalAnnotations
(Formatter.Annotation)));
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
392
.
WithAdditionalAnnotations
(Formatter.Annotation);
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (5)
510
return root.ReplaceNode(currentParent, updatedParent.
WithAdditionalAnnotations
(Formatter.Annotation));
534
return root.ReplaceNode(currentParent, updatedParent.
WithAdditionalAnnotations
(Formatter.Annotation));
560
return root.ReplaceNode(currentParent, updatedParent.
WithAdditionalAnnotations
(Formatter.Annotation));
583
return root.ReplaceNode(currentParent, updatedParent.
WithAdditionalAnnotations
(Formatter.Annotation));
608
return 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)
260
editor.ReplaceNode(nameToken.Parent, nameToken.Parent.
WithAdditionalAnnotations
(
300
editor.ReplaceNode(nameToken.Parent, nameToken.Parent.
WithAdditionalAnnotations
(
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
329
.
WithAdditionalAnnotations
(Simplifier.Annotation);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (3)
270
editor.ReplaceNode(parent, parent.
WithAdditionalAnnotations
(
275
editor.ReplaceNode(parent, parent.
WithAdditionalAnnotations
(
280
editor.ReplaceNode(parent, parent.
WithAdditionalAnnotations
(
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
61
currentRoots[typeNode.SyntaxTree] = typeNodeRoot.ReplaceNode(typeNode, typeNode.
WithAdditionalAnnotations
(typeNodeAnnotation));
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
83
var reformatSnippetNode = snippetExpressionNode.
WithAdditionalAnnotations
(FindSnippetAnnotation, Simplifier.Annotation, SymbolAnnotation.Create(consoleSymbol!), Formatter.Annotation);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
215
var reformatSnippetNode = snippetExpressionNode.
WithAdditionalAnnotations
(FindSnippetAnnotation, Simplifier.Annotation, Formatter.Annotation);
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
67
leftCondition = leftCondition.
WithAdditionalAnnotations
(Formatter.Annotation);
68
rightCondition = rightCondition.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
131
return (currentTarget.Parent, currentTarget.Parent.ReplaceNode(currentTarget, currentReplacement).
WithAdditionalAnnotations
(Simplifier.Annotation));
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
125
.
WithAdditionalAnnotations
(Formatter.Annotation);
128
parameterDeclaration = parameterDeclaration.
WithAdditionalAnnotations
(
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121
var newRoot = root.ReplaceNode(docCommentNode, newDocComment.
WithAdditionalAnnotations
(Formatter.Annotation));
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (1)
79
rewritten = 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)
181
let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).
WithAdditionalAnnotations
(Simplifier.Annotation)
199
.
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
38
switchNode, switchExpression).
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
39
switchNode, switchOperation).
WithAdditionalAnnotations
(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (5)
419
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
434
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
589
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(s_unusedLocalDeclarationAnnotation);
641
nodeReplacementMap.Add(localDeclarationStatement, localDeclarationStatement.
WithAdditionalAnnotations
(s_existingLocalDeclarationWithoutInitializerAnnotation));
690
.
WithAdditionalAnnotations
(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
112
conditionalExpression = conditionalExpression.
WithAdditionalAnnotations
(Simplifier.Annotation);
118
conditionalExpression = conditionalExpression.
WithAdditionalAnnotations
(
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
80
.
WithAdditionalAnnotations
(Formatter.Annotation);
Microsoft.CodeAnalysis.UnitTests (1)
CommonSyntaxTests.cs (1)
240
computeReplacementNode: (node, rewritten) => CSharp.SyntaxFactory.ParenthesizedExpression(rewritten).
WithAdditionalAnnotations
(annotation));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (4)
628
SyntaxFactory.EndSubStatement()).
WithAdditionalAnnotations
(annotations)
699
.
WithAdditionalAnnotations
(annotations)
708
.
WithAdditionalAnnotations
(annotations)
739
SyntaxFactory.EndSubStatement()).
WithAdditionalAnnotations
(annotations)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
43
Return 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)
43
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
42
Dim yieldStatement = SyntaxFactory.YieldStatement(returnStatement.Expression).
WithAdditionalAnnotations
(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
107
Dim newCastExpression = Uncast(castExpression).
WithAdditionalAnnotations
(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedValuesCodeFixProvider.vb (1)
71
Return proposedReplacementNode.
WithAdditionalAnnotations
(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
69
Dim result = newStatement.WithLeadingTrivia(totalTrivia).
WithAdditionalAnnotations
(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52
Return statement.ReplaceNode(declarator, declarator.
WithAdditionalAnnotations
(Simplifier.Annotation))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.StringPiece.vb (1)
73
Return result.
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (3)
144
Return DirectCast(expression, MemberAccessExpressionSyntax).
WithAdditionalAnnotations
(Simplifier.Annotation)
158
Return invocation.
WithAdditionalAnnotations
(Simplifier.Annotation)
404
.
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
38
result.
WithAdditionalAnnotations
(Simplifier.Annotation),
113
.
WithAdditionalAnnotations
(Simplifier.Annotation)
121
.
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\INamespaceOrTypeSymbolExtensions.vb (1)
15
Return symbol.Accept(TypeSyntaxGeneratorVisitor.Create(addGlobal)).
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ITypeSymbolExtensions.vb (1)
15
Return typeSymbol.Accept(New ExpressionSyntaxGeneratorVisitor(addGlobal:=True)).
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ParameterSyntaxExtensions.vb (1)
19
Dim newParameterSyntax = parameter.WithAsClause(Nothing).
WithAdditionalAnnotations
(annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (1)
92
Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (3)
94
Return SyntaxFactory.EndClassStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
96
Return SyntaxFactory.EndInterfaceStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
98
Return SyntaxFactory.EndStructureStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
Microsoft.CodeAnalysis.VisualBasic.Features (39)
AddImport\VisualBasicAddImportFeatureService.vb (1)
208
nameSyntax = nameSyntax.
WithAdditionalAnnotations
(Simplifier.Annotation)
ChangeSignature\UnifiedArgumentSyntax.vb (1)
52
Return New UnifiedArgumentSyntax(_argument.
WithAdditionalAnnotations
(annotation))
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (3)
195
Dim updatedDocument = Await document.ReplaceNodeAsync(node, updatedProperty.
WithAdditionalAnnotations
(Formatter.Annotation), cancellationToken).ConfigureAwait(False)
222
Dim updatedDocument = Await document.ReplaceNodeAsync(endStatement.Parent, updatedParent.
WithAdditionalAnnotations
(Formatter.Annotation), cancellationToken).ConfigureAwait(False)
257
updatedDocument = 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)
79
Return newNode.
WithAdditionalAnnotations
(Formatter.Annotation)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (1)
128
Dim attributeName = DirectCast(suppressMessageAttribute.GenerateTypeSyntax(), NameSyntax).
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (6)
123
Dim updatedDocument = Await document.ReplaceNodeAsync(modifiedIdentifier, modifiedIdentifier.
WithAdditionalAnnotations
(s_definitionAnnotation), cancellationToken).ConfigureAwait(False)
196
updatedDocument = 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)
75
Return implementsClause.AddInterfaceMembers(qualifiedName).
WithAdditionalAnnotations
(Formatter.Annotation)
77
Return SyntaxFactory.ImplementsClause(qualifiedName).
WithAdditionalAnnotations
(Formatter.Annotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.CallSiteContainerRewriter.vb (1)
95
Return node.
WithAdditionalAnnotations
(s_removeAnnotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.ExpressionCodeGenerator.vb (1)
120
.
WithAdditionalAnnotations
(enclosingStatementAnnotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (2)
99
Return container.CopyAnnotationsTo(callSiteGenerator.Generate()).
WithAdditionalAnnotations
(Formatter.Annotation)
329
Dim methodName As ExpressionSyntax = CreateMethodNameForInvocation().
WithAdditionalAnnotations
(Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService.Rewriter.vb (2)
29
.
WithAdditionalAnnotations
(_replacementAnnotation)
41
Return newNode.
WithAdditionalAnnotations
(Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (1)
34
name:=SyntaxFactory.IdentifierName(newNameToken)).
WithAdditionalAnnotations
(Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceLocal.vb (2)
93
SyntaxFactory.EndFunctionStatement()).
WithAdditionalAnnotations
(Formatter.Annotation)
126
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(Formatter.Annotation, localAnnotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceQueryLocal.vb (1)
30
expression)).
WithAdditionalAnnotations
(Formatter.Annotation)
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (1)
129
Return newPropertyDeclaration.
WithAdditionalAnnotations
(Formatter.Annotation)
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (1)
109
Return statement.
WithAdditionalAnnotations
(Formatter.Annotation)
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.vb (1)
42
Return 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)
43
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
42
Dim yieldStatement = SyntaxFactory.YieldStatement(returnStatement.Expression).
WithAdditionalAnnotations
(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
107
Dim newCastExpression = Uncast(castExpression).
WithAdditionalAnnotations
(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedValuesCodeFixProvider.vb (1)
71
Return proposedReplacementNode.
WithAdditionalAnnotations
(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
69
Dim result = newStatement.WithLeadingTrivia(totalTrivia).
WithAdditionalAnnotations
(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52
Return statement.ReplaceNode(declarator, declarator.
WithAdditionalAnnotations
(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (6)
Syntax\SyntaxAnnotationTests.vb (6)
150
Dim annotatedNode = node.
WithAdditionalAnnotations
(annotation1)
160
Dim twiceAnnotatedNode = node2.
WithAdditionalAnnotations
(annotation2)
270
Dim annotatedNode = lastChildOfFirstNode.
WithAdditionalAnnotations
(annotation1)
539
Dim newNode = nodeOrToken.AsNode().
WithAdditionalAnnotations
(annotation)
677
Return MyBase.Visit(node).
WithAdditionalAnnotations
(_annotation)
718
Return MyBase.Visit(node).
WithAdditionalAnnotations
(annotation)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (49)
CodeGeneration\VisualBasicSyntaxGenerator.vb (3)
140
Return SyntaxFactory.DirectCastExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).
WithAdditionalAnnotations
(Simplifier.Annotation)
144
Return SyntaxFactory.CTypeExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).
WithAdditionalAnnotations
(Simplifier.Annotation)
194
SyntaxFactory.SeparatedList(typeArguments.Cast(Of TypeSyntax)()))).
WithAdditionalAnnotations
(Simplifier.Annotation)
Rename\VisualBasicRenameRewriterLanguageService.vb (2)
189
newNode = newNode.
WithAdditionalAnnotations
(annotation)
211
expandedNewNode = expandedNewNode.
WithAdditionalAnnotations
(annotationForSpeculativeNode)
Simplification\Reducers\VisualBasicNameReducer.vb (1)
48
node = node.CopyAnnotationsTo(replacementNode).
WithAdditionalAnnotations
(Formatter.Annotation)
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
45
replacementNode = node.CopyAnnotationsTo(replacementNode).
WithAdditionalAnnotations
(Formatter.Annotation)
Simplification\Simplifiers\ExpressionSimplifier.vb (2)
187
replacementNode = memberAccess.Update(memberAccess.Kind, newLeft, memberAccess.OperatorToken, memberAccess.Name).
WithAdditionalAnnotations
(Simplifier.Annotation)
206
replacementNode = qualifiedName.Update(DirectCast(newLeft, NameSyntax), qualifiedName.DotToken, qualifiedName.Right).
WithAdditionalAnnotations
(Simplifier.Annotation)
Simplification\Simplifiers\NameSimplifier.vb (1)
186
replacementNode = replacementNode.
WithAdditionalAnnotations
(New SyntaxAnnotation(codeStyleOptionName))
Simplification\VisualBasicSimplificationService.Expander.vb (19)
117
.
WithAdditionalAnnotations
(Simplifier.Annotation)
120
Return 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)
258
newMemberAccess = originalNode.Expression.CopyAnnotationsTo(newMemberAccess).
WithAdditionalAnnotations
(Simplifier.Annotation)
267
.
WithAdditionalAnnotations
(Simplifier.Annotation)
275
Return originalNode.CopyAnnotationsTo(replacementNode).
WithAdditionalAnnotations
(Simplifier.Annotation)
289
.
WithAdditionalAnnotations
(Simplifier.Annotation)
311
WithAdditionalAnnotations
(Simplifier.Annotation).
343
.
WithAdditionalAnnotations
(Simplifier.Annotation)
386
WithAdditionalAnnotations
(Simplifier.Annotation)
519
.
WithAdditionalAnnotations
(Simplifier.Annotation)
605
newNode = DirectCast(newNode, SimpleNameSyntax).WithIdentifier(identifier).
WithAdditionalAnnotations
(Simplifier.Annotation)
640
.
WithAdditionalAnnotations
(Simplifier.Annotation)
676
newNode = newNode.
WithAdditionalAnnotations
(Simplifier.Annotation)
695
.
WithAdditionalAnnotations
(Simplifier.Annotation)
776
result = rewrittenNode.CopyAnnotationsTo(SyntaxFactory.QualifiedName(DirectCast(left, NameSyntax), right.
WithAdditionalAnnotations
(Simplifier.SpecialTypeAnnotation)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (4)
628
SyntaxFactory.EndSubStatement()).
WithAdditionalAnnotations
(annotations)
699
.
WithAdditionalAnnotations
(annotations)
708
.
WithAdditionalAnnotations
(annotations)
739
SyntaxFactory.EndSubStatement()).
WithAdditionalAnnotations
(annotations)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
43
Return node.
WithAdditionalAnnotations
(_annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.StringPiece.vb (1)
73
Return result.
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (3)
144
Return DirectCast(expression, MemberAccessExpressionSyntax).
WithAdditionalAnnotations
(Simplifier.Annotation)
158
Return invocation.
WithAdditionalAnnotations
(Simplifier.Annotation)
404
.
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
38
result.
WithAdditionalAnnotations
(Simplifier.Annotation),
113
.
WithAdditionalAnnotations
(Simplifier.Annotation)
121
.
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\INamespaceOrTypeSymbolExtensions.vb (1)
15
Return symbol.Accept(TypeSyntaxGeneratorVisitor.Create(addGlobal)).
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ITypeSymbolExtensions.vb (1)
15
Return typeSymbol.Accept(New ExpressionSyntaxGeneratorVisitor(addGlobal:=True)).
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ParameterSyntaxExtensions.vb (1)
19
Dim newParameterSyntax = parameter.WithAsClause(Nothing).
WithAdditionalAnnotations
(annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (1)
92
Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).
WithAdditionalAnnotations
(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (3)
94
Return SyntaxFactory.EndClassStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
96
Return SyntaxFactory.EndInterfaceStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
98
Return SyntaxFactory.EndStructureStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (1)
44
newRoot = newRoot.
WithAdditionalAnnotations
(Formatter.Annotation)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (4)
Formatting\FormattingTests.vb (4)
3777
root = root.ReplaceNode(implementsStatement, implementsStatement.NormalizeWhitespace(elasticTrivia:=True).
WithAdditionalAnnotations
(goo))
3780
root = root.ReplaceNode(field, field.NormalizeWhitespace(elasticTrivia:=True).
WithAdditionalAnnotations
(goo))
3782
root = root.ReplaceNode(prop, prop.NormalizeWhitespace(elasticTrivia:=True).
WithAdditionalAnnotations
(goo))
3785
root = root.ReplaceNode(method, method.NormalizeWhitespace(elasticTrivia:=True).
WithAdditionalAnnotations
(goo))
Microsoft.CodeAnalysis.Workspaces (35)
Editing\SyntaxGenerator.cs (3)
1910
name = 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)
212
var 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)
159
through.
WithAdditionalAnnotations
(Simplifier.Annotation));
174
through = through.
WithAdditionalAnnotations
(Simplifier.Annotation);
178
return through.
WithAdditionalAnnotations
(Simplifier.Annotation);
352
.
WithAdditionalAnnotations
(Simplifier.Annotation);
425
factory.IdentifierName(parameter.Name))).
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (4)
44
statements = statements.SelectAsArray(s => s.
WithAdditionalAnnotations
(statementAnnotation));
75
statements = statements.SelectAsArray(s => s.
WithAdditionalAnnotations
(statementAnnotation));
233
.
WithAdditionalAnnotations
(Simplification.Simplifier.Annotation);
478
s => s.
WithAdditionalAnnotations
(Simplifier.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
226
factory.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);
128
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
142
newNextStatement.
WithAdditionalAnnotations
(Formatter.Annotation).WithLeadingTrivia(
152
(current, generator) => current.
WithAdditionalAnnotations
(Formatter.Annotation).WithPrependedLeadingTrivia(
164
: declarationStatement.
WithAdditionalAnnotations
(warningAnnotation);
172
declarationStatement.
WithAdditionalAnnotations
(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
256
var newRoot = root.ReplaceNode(nodeOrToken.AsNode()!, currentNode.
WithAdditionalAnnotations
(marker));
305
(o, r) => r.
WithAdditionalAnnotations
(removeIfUnusedAnnotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (1)
35
to = to.
WithAdditionalAnnotations
(DoNotSimplifyAnnotation);
Microsoft.CodeAnalysis.Workspaces.UnitTests (7)
CodeCleanup\CodeCleanupTests.cs (2)
135
document = document.WithSyntaxRoot((await document.GetSyntaxRootAsync()).
WithAdditionalAnnotations
(annotation));
148
document = document.WithSyntaxRoot((await document.GetSyntaxRootAsync()).
WithAdditionalAnnotations
(annotation));
SolutionTests\SolutionTests.cs (4)
3191
var annotatedRoot = root.
WithAdditionalAnnotations
(annotation);
3433
tree = tree.
WithAdditionalAnnotations
(new SyntaxAnnotation("test"));
3693
var newRoot = doc.GetSyntaxRootAsync().Result.
WithAdditionalAnnotations
(SyntaxAnnotation.ElasticAnnotation);
5437
var newRoot = root.
WithAdditionalAnnotations
(new SyntaxAnnotation());
WorkspaceTests\AdhocWorkspaceTests.cs (1)
345
var newRoot = root.
WithAdditionalAnnotations
(new SyntaxAnnotation());
Microsoft.Interop.ComInterfaceGenerator (3)
Analyzers\AddGeneratedComClassFixer.cs (1)
28
var attribute = gen.Attribute(gen.TypeExpression(editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.GeneratedComClassAttribute)).
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation));
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (2)
78
var generatedComInterfaceAttribute = gen.Attribute(gen.TypeExpression(comp.GetTypeByMetadataName(TypeNames.GeneratedComInterfaceAttribute)).
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation));
93
generatedComInterfaceAttribute = generatedComInterfaceAttribute.
WithAdditionalAnnotations
(
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportFixer.cs (2)
186
generatedDeclaration = generatedDeclaration.
WithAdditionalAnnotations
(WarningAnnotation.Create(SR.ConvertNoPreserveSigDllImportToGeneratedMayProduceInvalidCode));
231
libraryImportSyntax = libraryImportSyntax.
WithAdditionalAnnotations
(
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\CSharpSnippetExpansionLanguageHelper.cs (1)
150
newUsings.Add(candidateUsing.
WithAdditionalAnnotations
(Formatter.Annotation).WithAppendedTrailingTrivia(SyntaxFactory.CarriageReturnLineFeed));
Microsoft.VisualStudio.LanguageServices.VisualBasic (6)
CodeModel\VisualBasicCodeModelService.vb (5)
1331
Dim newDeclarator = declarator.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).
WithAdditionalAnnotations
(Formatter.Annotation)
1344
Dim newDeclaration = declaration.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).
WithAdditionalAnnotations
(Formatter.Annotation)
1372
Dim newArgumentList = argumentList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).
WithAdditionalAnnotations
(Formatter.Annotation)
1379
Dim newParameterList = parameterList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).
WithAdditionalAnnotations
(Formatter.Annotation)
3939
.
WithAdditionalAnnotations
(Formatter.Annotation)
Snippets\VisualBasicSnippetExpansionLanguageHelper.vb (1)
160
importsToAdd.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)
155
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation)
160
WithAdditionalAnnotations
(Formatter.Annotation)