646 references to WithAdditionalAnnotations
IdeCoreBenchmarks (1)
FormatterBenchmarks.cs (1)
54
var root = document.GetSyntaxRootAsync(CancellationToken.None).Result.
WithAdditionalAnnotations
(Formatter.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 (3)
AbstractSpeculationAnalyzer.cs (1)
186
var annotatedExpression = _newExpressionForReplace.
WithAdditionalAnnotations
(annotation);
AnnotationTable.cs (1)
81
=> node.
WithAdditionalAnnotations
(this.GetOrCreateRealAnnotations(annotations).ToArray());
SyntaxNodeExtensions.cs (1)
310
return root.ReplaceNodes(tokenMap.Keys, (o, n) => o.
WithAdditionalAnnotations
(tokenMap[o]));
Microsoft.CodeAnalysis.CodeStyle.Fixes (44)
AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121
var newRoot = root.ReplaceNode(docCommentNode, newDocComment.
WithAdditionalAnnotations
(Formatter.Annotation));
AbstractAddExplicitCastCodeFixProvider.cs (2)
132
.
WithAdditionalAnnotations
(Simplifier.Annotation));
139
this.Cast(targetNode, conversionType).
WithAdditionalAnnotations
(Simplifier.Annotation));
AbstractCodeGenerationService.cs (1)
73
? node.
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation)
AbstractForEachCastCodeFixProvider.cs (1)
79
rewritten = rewritten.
WithAdditionalAnnotations
(
AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
93
.
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
104
.
WithAdditionalAnnotations
(Formatter.Annotation, annotation);
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));
AbstractPopulateSwitchCodeFixProvider.cs (2)
181
let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).
WithAdditionalAnnotations
(Simplifier.Annotation)
199
.
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
38
switchNode, switchExpression).
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
39
switchNode, switchOperation).
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractRemoveUnusedValuesCodeFixProvider.cs (7)
268
root = root.ReplaceNodes(memberDeclarations, computeReplacementNode: (_, n) => n.
WithAdditionalAnnotations
(s_memberAnnotation));
407
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
422
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
577
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(s_unusedLocalDeclarationAnnotation);
629
nodeReplacementMap.Add(localDeclarationStatement, localDeclarationStatement.
WithAdditionalAnnotations
(s_existingLocalDeclarationWithoutInitializerAnnotation));
657
editor.ReplaceNode(node, replacement.
WithAdditionalAnnotations
(Formatter.Annotation));
678
.
WithAdditionalAnnotations
(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
AbstractUseCollectionInitializerCodeFixProvider.cs (1)
97
.
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractUseConditionalExpressionCodeFixProvider.cs (2)
120
conditionalExpression = conditionalExpression.
WithAdditionalAnnotations
(Simplifier.Annotation);
126
conditionalExpression = conditionalExpression.
WithAdditionalAnnotations
(
AbstractUseNullPropagationCodeFixProvider.cs (1)
190
.
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractUseObjectInitializerCodeFixProvider.cs (1)
98
.
WithAdditionalAnnotations
(Formatter.Annotation);
AddParameterEditor.cs (4)
46
.
WithAdditionalAnnotations
(Formatter.Annotation);
73
.
WithAdditionalAnnotations
(Formatter.Annotation));
96
.
WithAdditionalAnnotations
(Formatter.Annotation));
117
.
WithAdditionalAnnotations
(Formatter.Annotation));
AddParameterService.cs (2)
125
.
WithAdditionalAnnotations
(Formatter.Annotation);
128
parameterDeclaration = parameterDeclaration.
WithAdditionalAnnotations
(
CodeGenerationHelpers.cs (2)
43
? syntax?.
WithAdditionalAnnotations
(codeGenerationSymbol.GetAnnotations())
47
=> node.
WithAdditionalAnnotations
(Formatter.Annotation, CodeGenerator.Annotation);
SimplificationHelpers.cs (1)
35
to = to.
WithAdditionalAnnotations
(DontSimplifyAnnotation);
SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
226
factory.IdentifierName(member.Name)).
WithAdditionalAnnotations
(Simplification.Simplifier.Annotation);
SyntaxGeneratorExtensions_Negate.cs (2)
500
.
WithAdditionalAnnotations
(Simplifier.Annotation);
544
.
WithAdditionalAnnotations
(Simplifier.Annotation);
UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
74
coalesceExpression = coalesceExpression.
WithAdditionalAnnotations
(
UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (2)
88
coalesceExpression = coalesceExpression.
WithAdditionalAnnotations
(
92
return coalesceExpression.
WithAdditionalAnnotations
(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
AnalyzedPattern.cs (1)
56
SyntaxFactory.ConstantPattern(SyntaxFactory.ParenthesizedExpression(binaryExpression.Right.
WithAdditionalAnnotations
(s_annotation)))
CSharpUseImplicitTypeHelper.cs (1)
199
SyntaxFactory.IdentifierName("var").WithTriviaFrom(declarationTypeNode).
WithAdditionalAnnotations
(annotation));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (63)
AssignOutParametersAboveReturnCodeFixProvider.cs (2)
67
(c, _) => c.
WithAdditionalAnnotations
(Formatter.Annotation));
87
.
WithAdditionalAnnotations
(Formatter.Annotation));
BaseNamespaceDeclarationSyntaxExtensions.cs (1)
27
newUsings = newUsings.Select(u => u.
WithAdditionalAnnotations
(annotations)).ToList();
CastExpressionSyntaxExtensions.cs (1)
31
.
WithAdditionalAnnotations
(Simplifier.Annotation);
CompilationUnitSyntaxExtensions.cs (1)
134
usings.Select(u => u.
WithAdditionalAnnotations
(annotations)).ToSyntaxList());
ConvertNamespaceTransform.cs (2)
98
converted.
WithAdditionalAnnotations
(annotation));
258
semicolonToken: default).
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
107
editor.ReplaceNode(switchStatement, switchExpressionStatement.
WithAdditionalAnnotations
(Formatter.Annotation));
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
269
node.Expression.Cast(expressionConvertedType).
WithAdditionalAnnotations
(Formatter.Annotation),
ConvertToRecordEngine.cs (1)
417
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpAddYieldCodeFixProvider.cs (1)
81
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpCodeGenerationHelpers.cs (1)
29
? result.
WithAdditionalAnnotations
(Formatter.Annotation)
CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
159
SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), newNameNode).
WithAdditionalAnnotations
(Simplifier.Annotation);
CSharpFixReturnTypeCodeFixProvider.cs (1)
127
fixedDeclaration = fixedDeclaration.
WithAdditionalAnnotations
(Simplifier.Annotation).WithTriviaFrom(declarationTypeToFix);
CSharpInlineDeclarationCodeFixProvider.cs (2)
304
newType = newType.WithoutTrivia().
WithAdditionalAnnotations
(Formatter.Annotation);
364
.
WithAdditionalAnnotations
(annotation));
CSharpIsAndCastCheckCodeFixProvider.cs (1)
103
return newIf.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpMakeMethodAsynchronousCodeFixProvider.cs (3)
118
var newReturnType = returnTypeSyntax.
WithAdditionalAnnotations
(Formatter.Annotation);
154
return newReturnType.WithTriviaFrom(returnTypeSyntax).
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation);
162
return result.
WithAdditionalAnnotations
(Simplifier.Annotation);
CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
67
? node.
WithAdditionalAnnotations
(Formatter.Annotation)
CSharpRemoveUnnecessaryCastCodeFixProvider.cs (3)
74
.
WithAdditionalAnnotations
(Simplifier.Annotation);
80
return castExpression.Uncast().
WithAdditionalAnnotations
(Formatter.Annotation)
86
.
WithAdditionalAnnotations
(Simplifier.Annotation);
CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (3)
66
.
WithAdditionalAnnotations
(Formatter.Annotation);
75
.
WithAdditionalAnnotations
(Formatter.Annotation));
84
.
WithAdditionalAnnotations
(Formatter.Annotation));
CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
229
.
WithAdditionalAnnotations
(Formatter.Annotation);
250
.
WithAdditionalAnnotations
(Formatter.Annotation));
CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
91
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpSyntaxFactsService.cs (1)
65
return node.
WithAdditionalAnnotations
(s_annotation);
CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
79
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (2)
47
statement.Declaration.Type.
WithAdditionalAnnotations
(Simplifier.Annotation)));
56
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
42
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpUseLocalFunctionCodeFixProvider.cs (1)
167
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
91
var patternSyntax = AsPatternSyntax(pattern).
WithAdditionalAnnotations
(Formatter.Annotation);
135
return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).
WithAdditionalAnnotations
(Simplifier.Annotation);
CSharpUseRangeOperatorCodeFixProvider.cs (1)
92
var argument = Argument(rangeExpression).
WithAdditionalAnnotations
(Formatter.Annotation);
ExpressionGenerator.cs (3)
289
memberAccess = memberAccess.
WithAdditionalAnnotations
(SpecialTypeAnnotation.Create(type.SpecialType));
293
return result.
WithAdditionalAnnotations
(Simplifier.Annotation);
316
result = result.
WithAdditionalAnnotations
(Simplifier.Annotation);
ExpressionSyntaxExtensions.cs (3)
49
? result.
WithAdditionalAnnotations
(Simplifier.Annotation)
80
? result.
WithAdditionalAnnotations
(Simplifier.Annotation)
92
return castExpression.
WithAdditionalAnnotations
(Simplifier.Annotation);
InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
111
newStatement = newStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
151
newStatement = newStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
ITypeSymbolExtensions.cs (6)
27
=> typeSymbol.Accept(ExpressionSyntaxGeneratorVisitor.Create(nameSyntax))!.
WithAdditionalAnnotations
(Simplifier.Annotation);
51
.
WithAdditionalAnnotations
(Simplifier.Annotation);
54
syntax = syntax.
WithAdditionalAnnotations
(DoNotAllowVarAnnotation.Annotation);
67
syntax = syntax.
WithAdditionalAnnotations
(additionalAnnotation);
78
.
WithAdditionalAnnotations
(Simplifier.Annotation);
88
.
WithAdditionalAnnotations
(Simplifier.Annotation);
ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
33
syntax = syntax.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol));
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
42
syntax = syntax.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxNodeExtensions.cs\SyntaxNodeExtensions.cs (1)
30
.
WithAdditionalAnnotations
(Formatter.Annotation);
MakeLocalFunctionStaticCodeFixHelper.cs (1)
200
localFunctionWithNewParameters = localFunctionWithNewParameters.
WithAdditionalAnnotations
(annotation);
MisplacedUsingDirectivesCodeFixProvider.cs (2)
198
.Select(d => d.
WithAdditionalAnnotations
(Formatter.Annotation, s_warningAnnotation));
230
.Select(directive => directive.
WithAdditionalAnnotations
(Formatter.Annotation, s_warningAnnotation));
UseExpressionBodyCodeFixProvider.cs (2)
73
editor.ReplaceNode(accessorList, (current, _) => current.
WithAdditionalAnnotations
(Formatter.Annotation));
88
.
WithAdditionalAnnotations
(Formatter.Annotation);
UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
19
=> UpdateWorker(semanticModel, originalDeclaration, currentDeclaration).
WithAdditionalAnnotations
(Formatter.Annotation);
UseSimpleUsingStatementCodeFixProvider.cs (1)
103
result[i] = result[i].
WithAdditionalAnnotations
(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (4)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (2)
41
rootEditor.ReplaceNode(oldNode, newNode.
WithAdditionalAnnotations
(s_replacementNodeAnnotation));
68
var annotatedNewNode = newNode.
WithAdditionalAnnotations
(s_replacementNodeAnnotation);
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
219
.WithRight(eventHookupExpression.Right.
WithAdditionalAnnotations
(Simplifier.Annotation))
220
.
WithAdditionalAnnotations
(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.Features (135)
AddImport\CSharpAddImportFeatureService.cs (2)
432
.
WithAdditionalAnnotations
(Formatter.Annotation),
485
.
WithAdditionalAnnotations
(Formatter.Annotation);
AnalyzedPattern.cs (1)
56
SyntaxFactory.ConstantPattern(SyntaxFactory.ParenthesizedExpression(binaryExpression.Right.
WithAdditionalAnnotations
(s_annotation)))
AssignOutParametersAboveReturnCodeFixProvider.cs (2)
67
(c, _) => c.
WithAdditionalAnnotations
(Formatter.Annotation));
87
.
WithAdditionalAnnotations
(Formatter.Annotation));
ChangeSignature\CSharpChangeSignatureService.cs (9)
311
return method.WithParameterList(method.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation));
317
return typeWithParameters.WithParameterList(typeWithParameters.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation));
323
return localFunction.WithParameterList(localFunction.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation));
329
return constructor.WithParameterList(constructor.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation));
335
return indexer.WithParameterList(indexer.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation));
341
return delegateDeclaration.WithParameterList(delegateDeclaration.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation));
353
return anonymousMethod.WithParameterList(anonymousMethod.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation));
536
.
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation);
568
.
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation);
ChangeSignature\UnifiedArgumentSyntax.cs (1)
60
=> new UnifiedArgumentSyntax(_argument.
WithAdditionalAnnotations
(annotation));
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (1)
111
.
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (3)
191
currentNode = currentNode.
WithAdditionalAnnotations
(Simplifier.Annotation);
211
currentNode = currentNode.
WithAdditionalAnnotations
(s_delegateToReplaceAnnotation);
249
newNode = newNode.
WithAdditionalAnnotations
(Simplifier.Annotation);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (7)
141
expressionToInline = expressionToInline.WithoutTrivia().Parenthesize().
WithAdditionalAnnotations
(Simplifier.Annotation, ExpressionAnnotation);
144
document = await document.ReplaceNodeAsync(declarator, declarator.
WithAdditionalAnnotations
(DefinitionAnnotation), cancellationToken).ConfigureAwait(false);
155
(o, n) => n.
WithAdditionalAnnotations
(ReferenceAnnotation),
201
n = n.
WithAdditionalAnnotations
(
209
n = n.
WithAdditionalAnnotations
(
312
newLocalDeclaration.
WithAdditionalAnnotations
(Formatter.Annotation));
381
expressionToInline = expressionToInline.
WithAdditionalAnnotations
(Formatter.Annotation);
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
255
.WithTriviaFrom(namespaceDecl.Name).
WithAdditionalAnnotations
(WarningAnnotation))
315
.
WithAdditionalAnnotations
(WarningAnnotation),
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (2)
140
return replacement.ConvertToSingleLine().
WithAdditionalAnnotations
(Formatter.Annotation);
191
return rewrittenPattern.ConvertToSingleLine().
WithAdditionalAnnotations
(Formatter.Annotation, Simplifier.Annotation);
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
101
.
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
144
variableStatement = variableStatement.
WithAdditionalAnnotations
(CreateWarningAnnotation());
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (2)
67
.
WithAdditionalAnnotations
(Formatter.Annotation);
141
.
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (2)
105
CreateDefaultStatement(queryOrLinqInvocationExpression, _modifyingExpression).
WithAdditionalAnnotations
(Formatter.Annotation));
193
SyntaxFactory.IdentifierName(MethodName))).
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (1)
44
.
WithAdditionalAnnotations
(Formatter.Annotation));
ConvertLinq\ConvertForEachToLinqQuery\YieldReturnConverter.cs (1)
45
SyntaxFactory.ReturnStatement(queryOrLinqInvocationExpression).
WithAdditionalAnnotations
(Formatter.Annotation));
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (13)
124
return SyntaxFactory.Block(SyntaxFactory.IfStatement(((WhereClauseSyntax)node).Condition.
WithAdditionalAnnotations
(Simplifier.Annotation).WithoutTrivia(), statement));
213
statement)))).
WithAdditionalAnnotations
(Simplifier.Annotation);
363
methodSymbol.GenerateReturnTypeSyntax().
WithAdditionalAnnotations
(Simplifier.Annotation),
447
nodesBeforeLocal = new[] { parentStatement.ReplaceNode(invocationExpression, initializer.
WithAdditionalAnnotations
(Simplifier.Annotation)) };
460
nodesAfterLocal = new StatementSyntax[] { parentStatement.ReplaceNode(invocationExpression, variableLocal.
WithAdditionalAnnotations
(Simplifier.Annotation)) };
509
nodesAfter = new[] { SyntaxFactory.ReturnStatement(variable).
WithAdditionalAnnotations
(Simplifier.Annotation) };
537
SyntaxFactory.EqualsValueClause(expression))))).
WithAdditionalAnnotations
(Simplifier.Annotation);
591
returnType: returnedType.GenerateTypeSyntax().
WithAdditionalAnnotations
(Simplifier.Annotation),
605
var localFunctionInvocation = SyntaxFactory.InvocationExpression(SyntaxFactory.IdentifierName(localFunctionToken)).
WithAdditionalAnnotations
(Simplifier.Annotation);
606
var newParentExpressionStatement = parentStatement.ReplaceNode(_source.WalkUpParentheses(), localFunctionInvocation.
WithAdditionalAnnotations
(Simplifier.Annotation));
709
forEachStatement.Statement).
WithAdditionalAnnotations
(Formatter.Annotation), queryExpressionProcessingInfo);
731
expression => forEachStatement.Statement.
WithAdditionalAnnotations
(Formatter.Annotation),
837
statements.Add(statement.
WithAdditionalAnnotations
(Simplifier.Annotation));
ConvertNamespaceTransform.cs (2)
98
converted.
WithAdditionalAnnotations
(annotation));
258
semicolonToken: default).
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
93
method = method.WithReturnType(method.ReturnType.
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation));
134
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));
ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
107
editor.ReplaceNode(switchStatement, switchExpressionStatement.
WithAdditionalAnnotations
(Formatter.Annotation));
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
269
node.Expression.Cast(expressionConvertedType).
WithAdditionalAnnotations
(Formatter.Annotation),
ConvertToRecordEngine.cs (1)
417
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpAddYieldCodeFixProvider.cs (1)
81
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
159
SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), newNameNode).
WithAdditionalAnnotations
(Simplifier.Annotation);
CSharpFixReturnTypeCodeFixProvider.cs (1)
127
fixedDeclaration = fixedDeclaration.
WithAdditionalAnnotations
(Simplifier.Annotation).WithTriviaFrom(declarationTypeToFix);
CSharpInlineDeclarationCodeFixProvider.cs (2)
304
newType = newType.WithoutTrivia().
WithAdditionalAnnotations
(Formatter.Annotation);
364
.
WithAdditionalAnnotations
(annotation));
CSharpIsAndCastCheckCodeFixProvider.cs (1)
103
return newIf.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpMakeMethodAsynchronousCodeFixProvider.cs (3)
118
var newReturnType = returnTypeSyntax.
WithAdditionalAnnotations
(Formatter.Annotation);
154
return newReturnType.WithTriviaFrom(returnTypeSyntax).
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation);
162
return result.
WithAdditionalAnnotations
(Simplifier.Annotation);
CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
67
? node.
WithAdditionalAnnotations
(Formatter.Annotation)
CSharpRemoveUnnecessaryCastCodeFixProvider.cs (3)
74
.
WithAdditionalAnnotations
(Simplifier.Annotation);
80
return castExpression.Uncast().
WithAdditionalAnnotations
(Formatter.Annotation)
86
.
WithAdditionalAnnotations
(Simplifier.Annotation);
CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (3)
66
.
WithAdditionalAnnotations
(Formatter.Annotation);
75
.
WithAdditionalAnnotations
(Formatter.Annotation));
84
.
WithAdditionalAnnotations
(Formatter.Annotation));
CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
91
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
79
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (2)
47
statement.Declaration.Type.
WithAdditionalAnnotations
(Simplifier.Annotation)));
56
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
42
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpUseLocalFunctionCodeFixProvider.cs (1)
167
.
WithAdditionalAnnotations
(Formatter.Annotation);
CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
91
var patternSyntax = AsPatternSyntax(pattern).
WithAdditionalAnnotations
(Formatter.Annotation);
135
return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).
WithAdditionalAnnotations
(Simplifier.Annotation);
CSharpUseRangeOperatorCodeFixProvider.cs (1)
92
var argument = Argument(rangeExpression).
WithAdditionalAnnotations
(Formatter.Annotation);
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
61
var updatedDeclarator = declarator.WithIdentifier(newIdentifier).
WithAdditionalAnnotations
(tempAnnotation);
81
.
WithAdditionalAnnotations
(Formatter.Annotation)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
146
return container.CopyAnnotationsTo(callSiteGenerator.Generate()).
WithAdditionalAnnotations
(Formatter.Annotation);
608
var methodName = CreateMethodNameForInvocation().
WithAdditionalAnnotations
(Simplifier.Annotation);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (3)
191
var callSignature = CreateCallSignature().
WithAdditionalAnnotations
(CallSiteAnnotation);
206
.ReplaceNode(sourceNode, sourceNode.
WithAdditionalAnnotations
(sourceNodeAnnotation))
207
.
WithAdditionalAnnotations
(enclosingStatementAnnotation);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs (1)
133
return Task.FromResult<SyntaxNode>(statement.
WithAdditionalAnnotations
(CallSiteAnnotation));
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.cs (1)
81
return Task.FromResult<SyntaxNode>(statement.
WithAdditionalAnnotations
(CallSiteAnnotation));
FullyQualify\CSharpFullyQualifyService.cs (1)
49
.
WithAdditionalAnnotations
(Formatter.Annotation);
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
211
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (1)
84
.
WithAdditionalAnnotations
(Formatter.Annotation);
InitializeParameter\InitializeParameterHelpers.cs (1)
111
(currentBlock, _) => currentBlock.
WithAdditionalAnnotations
(Formatter.Annotation));
IntroduceVariable\CSharpIntroduceVariableService.Rewriter.cs (2)
36
.
WithAdditionalAnnotations
(_replacementAnnotation);
51
return newNode.
WithAdditionalAnnotations
(Simplifier.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (2)
40
newQualifiedName = newQualifiedName.
WithAdditionalAnnotations
(Simplifier.Annotation);
51
SyntaxFactory.EqualsValueClause(expression.WithoutTrivia()))))).
WithAdditionalAnnotations
(Formatter.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (4)
110
.
WithAdditionalAnnotations
(Formatter.Annotation);
242
.
WithAdditionalAnnotations
(Formatter.Annotation);
292
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
329
SyntaxFactory.Block(root.GetCurrentNode(statement)).
WithAdditionalAnnotations
(Formatter.Annotation));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (1)
38
expression).
WithAdditionalAnnotations
(Formatter.Annotation);
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
178
: updatedIf.
WithAdditionalAnnotations
(Formatter.Annotation);
InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
111
newStatement = newStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
151
newStatement = newStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
MakeLocalFunctionStaticCodeFixHelper.cs (1)
200
localFunctionWithNewParameters = localFunctionWithNewParameters.
WithAdditionalAnnotations
(annotation);
MisplacedUsingDirectivesCodeFixProvider.cs (2)
198
.Select(d => d.
WithAdditionalAnnotations
(Formatter.Annotation, s_warningAnnotation));
230
.Select(directive => directive.
WithAdditionalAnnotations
(Formatter.Annotation, s_warningAnnotation));
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (5)
152
return property.
WithAdditionalAnnotations
(Formatter.Annotation);
185
.
WithAdditionalAnnotations
(Formatter.Annotation);
198
.
WithAdditionalAnnotations
(Formatter.Annotation);
224
return accessor.WithBody(getMethodDeclaration.Body.
WithAdditionalAnnotations
(Formatter.Annotation));
273
return accessor.WithBody(body.
WithAdditionalAnnotations
(Formatter.Annotation));
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (4)
140
.
WithAdditionalAnnotations
(Formatter.Annotation);
211
.
WithAdditionalAnnotations
(Formatter.Annotation);
269
.
WithAdditionalAnnotations
(Formatter.Annotation);
280
.
WithAdditionalAnnotations
(Formatter.Annotation);
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
354
return expr.
WithAdditionalAnnotations
(Formatter.Annotation);
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.cs (2)
54
var annotatedexpressionSyntax = expressionSyntax.
WithAdditionalAnnotations
(
60
annotatedexpressionSyntax = annotatedexpressionSyntax.ReplaceNode(right, right.
WithAdditionalAnnotations
(Simplifier.Annotation));
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
104
var newRoot = root.ReplaceNode(originalTypeDeclaration, newTypeDeclaration.
WithAdditionalAnnotations
(_cursorAnnotation, _findSnippetAnnotation));
SplitStringLiteral\InterpolatedStringSplitter.cs (1)
82
rightExpression.
WithAdditionalAnnotations
(RightNodeAnnotation));
SplitStringLiteral\SimpleStringSplitter.cs (1)
78
rightExpression.
WithAdditionalAnnotations
(RightNodeAnnotation));
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
81
return updatedProperty.WithTrailingTrivia(trailingTrivia).
WithAdditionalAnnotations
(SpecializedFormattingAnnotation);
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (1)
186
.
WithAdditionalAnnotations
(Formatter.Annotation);
UseExpressionBodyCodeFixProvider.cs (2)
73
editor.ReplaceNode(accessorList, (current, _) => current.
WithAdditionalAnnotations
(Formatter.Annotation));
88
.
WithAdditionalAnnotations
(Formatter.Annotation);
UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
19
=> UpdateWorker(semanticModel, originalDeclaration, currentDeclaration).
WithAdditionalAnnotations
(Formatter.Annotation);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
213
.
WithAdditionalAnnotations
(s_referenceAnnotation));
UseSimpleUsingStatementCodeFixProvider.cs (1)
103
result[i] = result[i].
WithAdditionalAnnotations
(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (13)
Syntax\SerializationTests.cs (6)
66
var root = tree.GetCompilationUnitRoot().
WithAdditionalAnnotations
(annotation);
90
var root = tree.GetCompilationUnitRoot().
WithAdditionalAnnotations
(annotation, annotation);
114
var root = tree.GetCompilationUnitRoot().
WithAdditionalAnnotations
(annotation);
143
var root = tree.GetCompilationUnitRoot().
WithAdditionalAnnotations
(annotation1);
162
var doubleAnnoRoot = droot.
WithAdditionalAnnotations
(annotation1, annotation2);
189
var root = tree.GetCompilationUnitRoot().
WithAdditionalAnnotations
(annotation1, annotation1);
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 (53)
BaseNamespaceDeclarationSyntaxExtensions.cs (1)
27
newUsings = newUsings.Select(u => u.
WithAdditionalAnnotations
(annotations)).ToList();
CastExpressionSyntaxExtensions.cs (1)
31
.
WithAdditionalAnnotations
(Simplifier.Annotation);
CodeGeneration\CSharpSyntaxGenerator.cs (5)
3138
=> SyntaxFactory.Block(AsStatementList(statements)).
WithAdditionalAnnotations
(Simplifier.Annotation);
3242
=> SyntaxFactory.DefaultExpression((TypeSyntax)type).
WithAdditionalAnnotations
(Simplifier.Annotation);
3292
=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).
WithAdditionalAnnotations
(Simplifier.Annotation);
3295
=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).
WithAdditionalAnnotations
(Simplifier.Annotation);
3422
=> SyntaxFactory.QualifiedName((NameSyntax)left, (SimpleNameSyntax)right).
WithAdditionalAnnotations
(Simplifier.Annotation);
CSharpCodeGenerationHelpers.cs (1)
29
? result.
WithAdditionalAnnotations
(Formatter.Annotation)
CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
229
.
WithAdditionalAnnotations
(Formatter.Annotation);
250
.
WithAdditionalAnnotations
(Formatter.Annotation));
CSharpSyntaxFactsService.cs (1)
65
return node.
WithAdditionalAnnotations
(s_annotation);
CSharpUseImplicitTypeHelper.cs (1)
199
SyntaxFactory.IdentifierName("var").WithTriviaFrom(declarationTypeNode).
WithAdditionalAnnotations
(annotation));
ExpressionGenerator.cs (3)
289
memberAccess = memberAccess.
WithAdditionalAnnotations
(SpecialTypeAnnotation.Create(type.SpecialType));
293
return result.
WithAdditionalAnnotations
(Simplifier.Annotation);
316
result = result.
WithAdditionalAnnotations
(Simplifier.Annotation);
ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
33
syntax = syntax.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol));
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
42
syntax = syntax.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs\CompilationUnitSyntaxExtensions.cs (1)
134
usings.Select(u => u.
WithAdditionalAnnotations
(annotations)).ToSyntaxList());
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs\ExpressionSyntaxExtensions.cs (3)
49
? result.
WithAdditionalAnnotations
(Simplifier.Annotation)
80
? result.
WithAdditionalAnnotations
(Simplifier.Annotation)
92
return castExpression.
WithAdditionalAnnotations
(Simplifier.Annotation);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (6)
27
=> typeSymbol.Accept(ExpressionSyntaxGeneratorVisitor.Create(nameSyntax))!.
WithAdditionalAnnotations
(Simplifier.Annotation);
51
.
WithAdditionalAnnotations
(Simplifier.Annotation);
54
syntax = syntax.
WithAdditionalAnnotations
(DoNotAllowVarAnnotation.Annotation);
67
syntax = syntax.
WithAdditionalAnnotations
(additionalAnnotation);
78
.
WithAdditionalAnnotations
(Simplifier.Annotation);
88
.
WithAdditionalAnnotations
(Simplifier.Annotation);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxNodeExtensions.cs\SyntaxNodeExtensions.cs (1)
30
.
WithAdditionalAnnotations
(Formatter.Annotation);
Rename\CSharpRenameRewriterLanguageService.cs (1)
293
newNode = newNode.
WithAdditionalAnnotations
(annotation);
Simplification\CSharpSimplificationService.Expander.cs (14)
186
var newParameter = parameters[i].WithType(typeSyntax).
WithAdditionalAnnotations
(Simplifier.Annotation);
233
simpleLambda.Body).
WithAdditionalAnnotations
(Simplifier.Annotation);
264
.
WithAdditionalAnnotations
(Simplifier.Annotation)
335
.
WithAdditionalAnnotations
(Simplifier.Annotation);
399
.
WithAdditionalAnnotations
(Simplifier.Annotation),
404
.
WithAdditionalAnnotations
(Simplifier.Annotation);
411
.
WithAdditionalAnnotations
(Simplifier.Annotation);
486
.
WithAdditionalAnnotations
(Simplifier.Annotation);
657
.
WithAdditionalAnnotations
(Simplifier.Annotation);
711
var result = newNode.
WithAdditionalAnnotations
(Simplifier.Annotation);
755
.
WithAdditionalAnnotations
(Simplifier.Annotation);
978
result = rewrittenNode.CopyAnnotationsTo(SyntaxFactory.QualifiedName((NameSyntax)left, right.
WithAdditionalAnnotations
(Simplifier.SpecialTypeAnnotation)));
1111
newMemberAccess = originalNode.Expression.CopyAnnotationsTo(newMemberAccess).
WithAdditionalAnnotations
(Simplifier.Annotation);
1125
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (1)
58
return node.
WithAdditionalAnnotations
(SimplificationHelpers.DontSimplifyAnnotation);
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (1)
65
.
WithAdditionalAnnotations
(Simplifier.Annotation);
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
48
var newParameterSyntax = parameterSyntax.WithType(null).
WithAdditionalAnnotations
(annotation);
Simplification\Reducers\CSharpNameReducer.cs (1)
63
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)
189
.
WithAdditionalAnnotations
<TypeSyntax>(new SyntaxAnnotation(
286
.
WithAdditionalAnnotations
(Simplifier.Annotation);
302
.
WithAdditionalAnnotations
(Simplifier.Annotation);
Simplification\Simplifiers\NameSimplifier.cs (1)
468
replacementNode = replacementNode.
WithAdditionalAnnotations
(new SyntaxAnnotation(codeStyleOptionName));
Simplification\Simplifiers\QualifiedCrefSimplifier.cs (1)
56
.
WithAdditionalAnnotations
(new SyntaxAnnotation(nameof(CodeStyleOptions2.PreferIntrinsicPredefinedTypeKeywordInMemberAccess)));
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\AddImportsTests.cs (1)
52
? c.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol), Simplifier.Annotation)
Formatting\FormattingElasticTriviaTests.cs (1)
117
var newDecl = generator.AddAttributes(decl, generator.Attribute("Some")).
WithAdditionalAnnotations
(Formatter.Annotation);
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (2)
Snippets\CSharpSnippets\SnippetFunctions\SnippetFunctionGenerateSwitchCases.cs (1)
96
var updatedRoot = syntaxRoot.ReplaceNode(nodeToReplace, nodeToReplace.
WithAdditionalAnnotations
(typeAnnotation, Simplifier.Annotation));
Snippets\CSharpSnippets\SnippetFunctions\SnippetFunctionSimpleTypeName.cs (1)
37
var updatedRoot = syntaxRoot.ReplaceNode(nodeToReplace, nodeToReplace.
WithAdditionalAnnotations
(typeAnnotation, Simplifier.Annotation));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeGeneration\AbstractCodeGenerationTests.cs (1)
40
root.
WithAdditionalAnnotations
(Simplifier.Annotation));
CodeGeneration\CodeGenerationTests.cs (3)
555
.
WithAdditionalAnnotations
(Formatter.Annotation);
574
.
WithAdditionalAnnotations
(Formatter.Annotation);
626
updatedDeclarationNode = updatedDeclarationNode.
WithAdditionalAnnotations
(Formatter.Annotation);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (5)
Simplification\AbstractSimplificationTests.vb (4)
82
root = root.ReplaceNode(node, node.
WithAdditionalAnnotations
(Simplifier.Annotation))
94
root = root.ReplaceNode(node, node.
WithAdditionalAnnotations
(Simplifier.Annotation))
100
root = root.ReplaceNode(node, node.
WithAdditionalAnnotations
(Simplifier.Annotation))
106
root = root.ReplaceNode(node, node.
WithAdditionalAnnotations
(Simplifier.Annotation))
Simplification\ParameterSimplificationTests.vb (1)
27
(Await document.GetSyntaxRootAsync()).
WithAdditionalAnnotations
(Simplifier.Annotation))
Microsoft.CodeAnalysis.Features (95)
AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121
var newRoot = root.ReplaceNode(docCommentNode, newDocComment.
WithAdditionalAnnotations
(Formatter.Annotation));
AbstractAddExplicitCastCodeFixProvider.cs (2)
132
.
WithAdditionalAnnotations
(Simplifier.Annotation));
139
this.Cast(targetNode, conversionType).
WithAdditionalAnnotations
(Simplifier.Annotation));
AbstractForEachCastCodeFixProvider.cs (1)
79
rewritten = rewritten.
WithAdditionalAnnotations
(
AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
93
.
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
104
.
WithAdditionalAnnotations
(Formatter.Annotation, annotation);
AbstractPopulateSwitchCodeFixProvider.cs (2)
181
let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).
WithAdditionalAnnotations
(Simplifier.Annotation)
199
.
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
38
switchNode, switchExpression).
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
39
switchNode, switchOperation).
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractRemoveUnusedValuesCodeFixProvider.cs (7)
268
root = root.ReplaceNodes(memberDeclarations, computeReplacementNode: (_, n) => n.
WithAdditionalAnnotations
(s_memberAnnotation));
407
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
422
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
577
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(s_unusedLocalDeclarationAnnotation);
629
nodeReplacementMap.Add(localDeclarationStatement, localDeclarationStatement.
WithAdditionalAnnotations
(s_existingLocalDeclarationWithoutInitializerAnnotation));
657
editor.ReplaceNode(node, replacement.
WithAdditionalAnnotations
(Formatter.Annotation));
678
.
WithAdditionalAnnotations
(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
AbstractUseCollectionInitializerCodeFixProvider.cs (1)
97
.
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractUseConditionalExpressionCodeFixProvider.cs (2)
120
conditionalExpression = conditionalExpression.
WithAdditionalAnnotations
(Simplifier.Annotation);
126
conditionalExpression = conditionalExpression.
WithAdditionalAnnotations
(
AbstractUseNullPropagationCodeFixProvider.cs (1)
190
.
WithAdditionalAnnotations
(Formatter.Annotation);
AbstractUseObjectInitializerCodeFixProvider.cs (1)
98
.
WithAdditionalAnnotations
(Formatter.Annotation);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (1)
65
.
WithAdditionalAnnotations
(Formatter.Annotation);
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
153
.
WithAdditionalAnnotations
(
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (1)
74
var updatedRoot = newRoot.
WithAdditionalAnnotations
(SuppressDiagnosticsAnnotation.Create());
AddParameterService.cs (2)
125
.
WithAdditionalAnnotations
(Formatter.Annotation);
128
parameterDeclaration = parameterDeclaration.
WithAdditionalAnnotations
(
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (1)
68
var newNamespaceDeclaration = syntaxGenerator.NamespaceDeclaration(name, WithElasticTrivia(typeToMove)).
WithAdditionalAnnotations
(NamespaceScopeMovedAnnotation);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (5)
317
documentEditor.ReplaceNode(container, container.
WithAdditionalAnnotations
(ContainerAnnotation));
416
import = import.
WithAdditionalAnnotations
(Formatter.Annotation);
628
.
WithAdditionalAnnotations
(Formatter.Annotation);
634
root = root.
WithAdditionalAnnotations
(Simplifier.Annotation);
736
editor.ReplaceNode(oldNode, newNode.
WithAdditionalAnnotations
(Simplifier.Annotation));
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
113
document = document.WithSyntaxRoot(newRoot.ReplaceNode(declaration, declaration.
WithAdditionalAnnotations
(_annotation)));
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
239
return syntaxGenerator.NamespaceImportDeclaration(namespaceName).
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
240
.
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
130
return ConvertToTuple(anonCreation).
WithAdditionalAnnotations
(Formatter.Annotation);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
101
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)
198
? piece.
WithAdditionalAnnotations
(Simplifier.Annotation)
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
317
syntaxFacts.ConvertToSingleLine(expressions[index], useElasticTrivia: true).
WithAdditionalAnnotations
(Formatter.Annotation));
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (3)
351
fullTypeName = fullTypeName.
WithAdditionalAnnotations
(Simplifier.Annotation)
352
.
WithAdditionalAnnotations
(DoNotAllowVarAnnotation.Annotation);
705
.
WithAdditionalAnnotations
(Formatter.Annotation);
EncapsulateField\AbstractEncapsulateFieldService.cs (4)
178
fieldDeclaration.GetSyntax(cancellationToken).
WithAdditionalAnnotations
(declarationAnnotation)));
192
var updatedRoot = linkedRoot.ReplaceNode(linkedFieldNode, linkedFieldNode.
WithAdditionalAnnotations
(declarationAnnotation));
418
assigned.
WithAdditionalAnnotations
(Simplifier.Annotation),
436
value.
WithAdditionalAnnotations
(Simplifier.Annotation));
ExtractInterface\AbstractExtractInterfaceService.cs (1)
358
var unformattedTypeDeclaration = syntaxGenerator.AddInterfaceType(typeDeclaration, typeReference).
WithAdditionalAnnotations
(Formatter.Annotation);
ExtractMethod\MethodExtractor.CodeGenerator.cs (2)
253
declarationStatement = declarationStatement.
WithAdditionalAnnotations
(CallSiteAnnotation);
260
CreateAssignmentExpressionStatement(CreateIdentifier(variable.Name), CreateCallSignature()).
WithAdditionalAnnotations
(CallSiteAnnotation));
GenerateMember\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
72
localStatement = localStatement.
WithAdditionalAnnotations
(Formatter.Annotation);
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
528
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)
393
.
WithAdditionalAnnotations
(Formatter.Annotation);
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (5)
511
return root.ReplaceNode(currentParent, updatedParent.
WithAdditionalAnnotations
(Formatter.Annotation));
536
return root.ReplaceNode(currentParent, updatedParent.
WithAdditionalAnnotations
(Formatter.Annotation));
563
return root.ReplaceNode(currentParent, updatedParent.
WithAdditionalAnnotations
(Formatter.Annotation));
586
return root.ReplaceNode(currentParent, updatedParent.
WithAdditionalAnnotations
(Formatter.Annotation));
611
return root.ReplaceNode(currentParent, updatedParent.
WithAdditionalAnnotations
(Formatter.Annotation));
InvertLogical\AbstractInvertLogicalCodeRefactoringProvider.cs (1)
111
newBinary.
WithAdditionalAnnotations
(s_annotation)));
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (3)
292
.
WithAdditionalAnnotations
(Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType)));
319
.
WithAdditionalAnnotations
(Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType)));
331
.
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType)),
PullMemberUp\MembersPuller.cs (3)
318
.
WithAdditionalAnnotations
(s_destinationNodeAnnotation);
335
.
WithAdditionalAnnotations
(s_removableImportAnnotation));
348
.
WithAdditionalAnnotations
(s_removableImportAnnotation)));
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
80
token.Parent.ReplaceToken(token, default(SyntaxToken)).
WithAdditionalAnnotations
(Formatter.Annotation)));
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
264
editor.ReplaceNode(nameToken.Parent, nameToken.Parent.
WithAdditionalAnnotations
(
304
editor.ReplaceNode(nameToken.Parent, nameToken.Parent.
WithAdditionalAnnotations
(
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
329
.
WithAdditionalAnnotations
(Simplifier.Annotation);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
271
editor.ReplaceNode(parent, parent.
WithAdditionalAnnotations
(
276
editor.ReplaceNode(parent, parent.
WithAdditionalAnnotations
(
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
69
currentRoots[typeNode.SyntaxTree] = typeNodeRoot.ReplaceNode(typeNode, typeNode.
WithAdditionalAnnotations
(typeNodeAnnotation));
Shared\Utilities\ExtractTypeHelpers.cs (3)
39
.
WithAdditionalAnnotations
(SimplificationHelpers.SimplifyModuleNameAnnotation);
42
newTypeNode = newTypeNode.
WithAdditionalAnnotations
(typeAnnotation);
107
var annotatedRoot = syntaxRoot.ReplaceNode(declarationNode, declarationNode.
WithAdditionalAnnotations
(typeAnnotation));
Snippets\SnippetFunctionService.cs (1)
152
var updatedRoot = syntaxRoot.ReplaceNode(nodeToReplace, nodeToReplace.
WithAdditionalAnnotations
(typeAnnotation, Simplifier.Annotation));
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
111
var reformatSnippetNode = snippetExpressionNode.
WithAdditionalAnnotations
(findSnippetAnnotation, cursorAnnotation, Simplifier.Annotation, SymbolAnnotation.Create(consoleSymbol!), Formatter.Annotation);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
236
var reformatSnippetNode = snippetExpressionNode.
WithAdditionalAnnotations
(findSnippetAnnotation, cursorAnnotation, Simplifier.Annotation, Formatter.Annotation);
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (1)
91
newCondition = newCondition.
WithAdditionalAnnotations
(Formatter.Annotation);
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
67
leftCondition = leftCondition.
WithAdditionalAnnotations
(Formatter.Annotation);
68
rightCondition = rightCondition.
WithAdditionalAnnotations
(Formatter.Annotation);
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (1)
85
return root.ReplaceNode(outerIfOrElseIf, newIfOrElseIf.
WithAdditionalAnnotations
(Formatter.Annotation));
SplitOrMergeIfStatements\Nested\AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider.cs (1)
57
root.ReplaceNode(ifOrElseIf, outerIfOrElseIf.
WithAdditionalAnnotations
(Formatter.Annotation)));
UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
74
coalesceExpression = coalesceExpression.
WithAdditionalAnnotations
(
UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (2)
88
coalesceExpression = coalesceExpression.
WithAdditionalAnnotations
(
92
return coalesceExpression.
WithAdditionalAnnotations
(Formatter.Annotation);
Wrapping\AbstractCodeActionComputer.cs (1)
244
computeReplacementNode: (oldNode, newNode) => newNode.
WithAdditionalAnnotations
(s_toFormatAnnotation),
Microsoft.CodeAnalysis.UnitTests (1)
CommonSyntaxTests.cs (1)
240
computeReplacementNode: (node, rewritten) => CSharp.SyntaxFactory.ParenthesizedExpression(rewritten).
WithAdditionalAnnotations
(annotation));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (6)
SpeculationAnalyzer.vb (1)
88
Dim annotatedOriginalExpression = originalExpression.
WithAdditionalAnnotations
(originalExprAnnotation)
SyntaxNodeExtensions.vb (4)
657
SyntaxFactory.EndSubStatement()).
WithAdditionalAnnotations
(annotations)
728
.
WithAdditionalAnnotations
(annotations)
737
.
WithAdditionalAnnotations
(annotations)
768
SyntaxFactory.EndSubStatement()).
WithAdditionalAnnotations
(annotations)
VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
43
Return node.
WithAdditionalAnnotations
(_annotation)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (21)
CompilationUnitSyntaxExtensions.vb (1)
85
[imports].Select(Function(u) u.
WithAdditionalAnnotations
(annotations)).ToSyntaxList())
ExpressionSyntaxExtensions.vb (3)
38
result.
WithAdditionalAnnotations
(Simplifier.Annotation),
113
.
WithAdditionalAnnotations
(Simplifier.Annotation)
121
.
WithAdditionalAnnotations
(Simplifier.Annotation)
ExpressionSyntaxGeneratorVisitor.vb (1)
28
expression = expression.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol))
INamespaceOrTypeSymbolExtensions.vb (1)
15
Return symbol.Accept(TypeSyntaxGeneratorVisitor.Create(addGlobal)).
WithAdditionalAnnotations
(Simplifier.Annotation)
ITypeSymbolExtensions.vb (1)
15
Return typeSymbol.Accept(New ExpressionSyntaxGeneratorVisitor(addGlobal:=True)).
WithAdditionalAnnotations
(Simplifier.Annotation)
ParameterSyntaxExtensions.vb (1)
19
Dim newParameterSyntax = parameter.WithAsClause(Nothing).
WithAdditionalAnnotations
(annotation)
StringExtensions.vb (1)
92
Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).
WithAdditionalAnnotations
(Simplifier.Annotation)
TypeBlockSyntaxExtensions.vb (3)
94
Return SyntaxFactory.EndClassStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
96
Return SyntaxFactory.EndInterfaceStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
98
Return SyntaxFactory.EndStructureStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
TypeSyntaxGeneratorVisitor.vb (1)
33
type = type.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol))
VisualBasicChangeToYieldCodeFixProvider.vb (1)
42
Dim yieldStatement = SyntaxFactory.YieldStatement(returnStatement.Expression).
WithAdditionalAnnotations
(Formatter.Annotation)
VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
43
WithAdditionalAnnotations
(Simplifier.Annotation)
VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (2)
100
.
WithAdditionalAnnotations
(Formatter.Annotation)
105
.
WithAdditionalAnnotations
(Formatter.Annotation)
VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
89
Dim returnType = knownTypes.TaskOfTType.Construct(methodSymbol.ReturnType).GenerateTypeSyntax().
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation)
VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
108
Dim newCastExpression = Uncast(castExpression).
WithAdditionalAnnotations
(Formatter.Annotation)
VisualBasicRemoveUnnecessaryImportsService.vb (1)
47
newRoot = newRoot.
WithAdditionalAnnotations
(Formatter.Annotation)
VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52
Return statement.ReplaceNode(declarator, declarator.
WithAdditionalAnnotations
(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Features (60)
AddImport\VisualBasicAddImportFeatureService.vb (2)
208
nameSyntax = nameSyntax.
WithAdditionalAnnotations
(Simplifier.Annotation)
303
newRoot = newRoot.
WithAdditionalAnnotations
(CaseCorrector.Annotation, Formatter.Annotation)
ChangeSignature\UnifiedArgumentSyntax.vb (1)
52
Return New UnifiedArgumentSyntax(_argument.
WithAdditionalAnnotations
(annotation))
ChangeSignature\VisualBasicChangeSignatureService.vb (10)
300
Return method.WithParameterList(method.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation))
308
eventStatement = eventStatement.WithParameterList(eventStatement.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation))
319
Return eventBlock.WithEventStatement(eventBlock.EventStatement.WithParameterList(eventBlock.EventStatement.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation)))
326
Dim updatedRaiseEventAccessor = raiseEventAccessor.WithAccessorStatement(raiseEventAccessor.AccessorStatement.WithParameterList(raiseEventAccessor.AccessorStatement.ParameterList.WithParameters(updatedParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation)))
389
Return constructor.WithParameterList(constructor.ParameterList.WithParameters(newParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation))
435
Return propertyStatement.WithParameterList(propertyStatement.ParameterList.WithParameters(newParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation))
460
Dim newBegin = lambda.SubOrFunctionHeader.WithParameterList(lambda.SubOrFunctionHeader.ParameterList.WithParameters(newParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation))
474
Dim newBegin = lambda.SubOrFunctionHeader.WithParameterList(lambda.SubOrFunctionHeader.ParameterList.WithParameters(newParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation))
482
Return delegateStatement.WithParameterList(delegateStatement.ParameterList.WithParameters(newParameters).
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation))
518
WithAdditionalAnnotations
(changeSignatureFormattingAnnotation)
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)
81
Return newNode.
WithAdditionalAnnotations
(Formatter.Annotation)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (1)
128
Dim attributeName = DirectCast(suppressMessageAttribute.GenerateTypeSyntax(), NameSyntax).
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.ReferenceRewriter.vb (1)
61
.
WithAdditionalAnnotations
(Formatter.Annotation, Simplifier.Annotation)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (8)
123
Dim updatedDocument = Await document.ReplaceNodeAsync(modifiedIdentifier, modifiedIdentifier.
WithAdditionalAnnotations
(s_definitionAnnotation), cancellationToken).ConfigureAwait(False)
143
Function(o, n) n.
WithAdditionalAnnotations
(s_referenceAnnotation),
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)
401
Return explicitInitializer.
WithAdditionalAnnotations
(s_expressionToInlineAnnotation)
466
.
WithAdditionalAnnotations
(ConflictAnnotation.Create(VBFeaturesResources.Conflict_s_detected))
ConvertForEachToFor\VisualBasicConvertForEachToForCodeRefactoringProvider.vb (1)
146
variableStatement = variableStatement.
WithAdditionalAnnotations
(CreateWarningAnnotation())
EncapsulateField\VisualBasicEncapsulateFieldService.vb (2)
51
root = root.ReplaceNode(fieldIdentifier, fieldIdentifier.WithIdentifier(newIdentifier).
WithAdditionalAnnotations
(annotation, Formatter.Annotation))
63
.
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 (3)
120
Dim callSignature = CreateCallSignature().
WithAdditionalAnnotations
(CallSiteAnnotation)
135
.ReplaceNode(sourceNode, sourceNode.
WithAdditionalAnnotations
(sourceNodeAnnotation)) _
136
.
WithAdditionalAnnotations
(enclosingStatementAnnotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.MultipleStatementsCodeGenerator.vb (1)
77
Return Task.FromResult(GetStatementContainingInvocationToExtractedMethodWorker().
WithAdditionalAnnotations
(CallSiteAnnotation))
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.SingleStatementCodeGenerator.vb (1)
66
Return Task.FromResult(GetStatementContainingInvocationToExtractedMethodWorker().
WithAdditionalAnnotations
(CallSiteAnnotation))
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (2)
107
Return container.CopyAnnotationsTo(callSiteGenerator.Generate()).
WithAdditionalAnnotations
(Formatter.Annotation)
330
Dim methodName As ExpressionSyntax = CreateMethodNameForInvocation().
WithAdditionalAnnotations
(Simplifier.Annotation)
FullyQualify\VisualBasicFullyQualifyService.vb (1)
67
WithAdditionalAnnotations
(Formatter.Annotation, CaseCorrector.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService.Rewriter.vb (2)
29
.
WithAdditionalAnnotations
(_replacementAnnotation)
41
Return newNode.
WithAdditionalAnnotations
(Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (2)
34
name:=SyntaxFactory.IdentifierName(newNameToken)).
WithAdditionalAnnotations
(Simplifier.Annotation)
215
.
WithAdditionalAnnotations
(Formatter.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)
128
Return newPropertyDeclaration.
WithAdditionalAnnotations
(Formatter.Annotation)
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (1)
110
Return statement.
WithAdditionalAnnotations
(Formatter.Annotation)
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.vb (1)
42
Return expression.
WithAdditionalAnnotations
(Simplifier.Annotation)
VisualBasicChangeToYieldCodeFixProvider.vb (1)
42
Dim yieldStatement = SyntaxFactory.YieldStatement(returnStatement.Expression).
WithAdditionalAnnotations
(Formatter.Annotation)
VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
43
WithAdditionalAnnotations
(Simplifier.Annotation)
VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (2)
100
.
WithAdditionalAnnotations
(Formatter.Annotation)
105
.
WithAdditionalAnnotations
(Formatter.Annotation)
VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
89
Dim returnType = knownTypes.TaskOfTType.Construct(methodSymbol.ReturnType).GenerateTypeSyntax().
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation)
VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
108
Dim newCastExpression = Uncast(castExpression).
WithAdditionalAnnotations
(Formatter.Annotation)
VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52
Return statement.ReplaceNode(declarator, declarator.
WithAdditionalAnnotations
(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (12)
Syntax\SerializationTests.vb (6)
72
Dim root = tree.GetRoot().
WithAdditionalAnnotations
(annotation)
98
Dim root = tree.GetRoot().
WithAdditionalAnnotations
(annotation, annotation)
124
Dim root = tree.GetRoot().
WithAdditionalAnnotations
(annotation1)
143
Dim doubleAnnoRoot = droot.
WithAdditionalAnnotations
(annotation1, annotation2)
172
Dim root = tree.GetRoot().
WithAdditionalAnnotations
(annotation1, annotation1)
198
Dim root = tree.GetRoot().
WithAdditionalAnnotations
(annotation)
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 (60)
CodeGeneration\ExpressionGenerator.StringPiece.vb (1)
73
Return result.
WithAdditionalAnnotations
(Simplifier.Annotation)
CodeGeneration\ExpressionGenerator.vb (4)
144
Return DirectCast(expression, MemberAccessExpressionSyntax).
WithAdditionalAnnotations
(Simplifier.Annotation)
158
Return invocation.
WithAdditionalAnnotations
(Simplifier.Annotation)
391
Return expression.
WithAdditionalAnnotations
(SpecialTypeAnnotation.Create(type))
404
.
WithAdditionalAnnotations
(Simplifier.Annotation)
CodeGeneration\VisualBasicSyntaxGenerator.vb (3)
148
Return SyntaxFactory.DirectCastExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).
WithAdditionalAnnotations
(Simplifier.Annotation)
152
Return SyntaxFactory.CTypeExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).
WithAdditionalAnnotations
(Simplifier.Annotation)
202
SyntaxFactory.SeparatedList(typeArguments.Cast(Of TypeSyntax)()))).
WithAdditionalAnnotations
(Simplifier.Annotation)
CompilationUnitSyntaxExtensions.vb (1)
85
[imports].Select(Function(u) u.
WithAdditionalAnnotations
(annotations)).ToSyntaxList())
ExpressionSyntaxGeneratorVisitor.vb (1)
28
expression = expression.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol))
INamespaceOrTypeSymbolExtensions.vb (1)
15
Return symbol.Accept(TypeSyntaxGeneratorVisitor.Create(addGlobal)).
WithAdditionalAnnotations
(Simplifier.Annotation)
ITypeSymbolExtensions.vb (1)
15
Return typeSymbol.Accept(New ExpressionSyntaxGeneratorVisitor(addGlobal:=True)).
WithAdditionalAnnotations
(Simplifier.Annotation)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb\ExpressionSyntaxExtensions.vb (3)
38
result.
WithAdditionalAnnotations
(Simplifier.Annotation),
113
.
WithAdditionalAnnotations
(Simplifier.Annotation)
121
.
WithAdditionalAnnotations
(Simplifier.Annotation)
ParameterSyntaxExtensions.vb (1)
19
Dim newParameterSyntax = parameter.WithAsClause(Nothing).
WithAdditionalAnnotations
(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 (4)
140
replacementNode = replacementNode.
WithAdditionalAnnotations
(
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)
260
replacementNode = containingType.GenerateTypeSyntax().WithLeadingTrivia(left.GetLeadingTrivia()).WithTrailingTrivia(left.GetTrailingTrivia()).
WithAdditionalAnnotations
(Simplifier.Annotation)
Simplification\Simplifiers\NameSimplifier.vb (1)
186
replacementNode = replacementNode.
WithAdditionalAnnotations
(New SyntaxAnnotation(codeStyleOptionName))
Simplification\VisualBasicSimplificationService.Expander.vb (21)
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)
433
.
WithAdditionalAnnotations
(Simplifier.Annotation, SimplificationHelpers.SimplifyModuleNameAnnotation),
467
.
WithAdditionalAnnotations
(Simplifier.Annotation, SimplificationHelpers.SimplifyModuleNameAnnotation),
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)))
Simplification\VisualBasicSimplificationService.NodesAndTokensToReduceComputer.vb (2)
51
Return node.
WithAdditionalAnnotations
(SimplificationHelpers.DontSimplifyAnnotation)
156
Return node.
WithAdditionalAnnotations
(SimplificationHelpers.DontSimplifyAnnotation)
SpeculationAnalyzer.vb (1)
88
Dim annotatedOriginalExpression = originalExpression.
WithAdditionalAnnotations
(originalExprAnnotation)
StringExtensions.vb (1)
92
Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).
WithAdditionalAnnotations
(Simplifier.Annotation)
SyntaxNodeExtensions.vb (4)
657
SyntaxFactory.EndSubStatement()).
WithAdditionalAnnotations
(annotations)
728
.
WithAdditionalAnnotations
(annotations)
737
.
WithAdditionalAnnotations
(annotations)
768
SyntaxFactory.EndSubStatement()).
WithAdditionalAnnotations
(annotations)
TypeBlockSyntaxExtensions.vb (3)
94
Return SyntaxFactory.EndClassStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
96
Return SyntaxFactory.EndInterfaceStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
98
Return SyntaxFactory.EndStructureStatement().
WithAdditionalAnnotations
(Formatter.Annotation)
TypeSyntaxGeneratorVisitor.vb (1)
33
type = type.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol))
VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
43
Return node.
WithAdditionalAnnotations
(_annotation)
VisualBasicRemoveUnnecessaryImportsService.vb (1)
47
newRoot = newRoot.
WithAdditionalAnnotations
(Formatter.Annotation)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (5)
CodeGeneration\AddImportsTests.vb (1)
56
Return c.
WithAdditionalAnnotations
(SymbolAnnotation.Create(symbol), Simplifier.Annotation)
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 (36)
AbstractCodeGenerationService.cs (1)
73
? node.
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation)
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));
AbstractSpeculationAnalyzer.cs (1)
186
var annotatedExpression = _newExpressionForReplace.
WithAdditionalAnnotations
(annotation);
AddParameterEditor.cs (4)
46
.
WithAdditionalAnnotations
(Formatter.Annotation);
73
.
WithAdditionalAnnotations
(Formatter.Annotation));
96
.
WithAdditionalAnnotations
(Formatter.Annotation));
117
.
WithAdditionalAnnotations
(Formatter.Annotation));
AnnotationTable.cs (1)
81
=> node.
WithAdditionalAnnotations
(this.GetOrCreateRealAnnotations(annotations).ToArray());
CodeGenerationHelpers.cs (2)
43
? syntax?.
WithAdditionalAnnotations
(codeGenerationSymbol.GetAnnotations())
47
=> node.
WithAdditionalAnnotations
(Formatter.Annotation, CodeGenerator.Annotation);
Editing\ImportAdderService.cs (2)
103
.
WithAdditionalAnnotations
(Simplifier.Annotation, Formatter.Annotation);
154
(o, r) => r.
WithAdditionalAnnotations
(Simplifier.Annotation, annotation));
Editing\SyntaxGenerator.cs (3)
1899
name = QualifiedName(name, IdentifierName(part)).
WithAdditionalAnnotations
(Simplifier.Annotation);
1934
: expression.
WithAdditionalAnnotations
(DoNotAddImportsAnnotation.Annotation);
2159
.
WithAdditionalAnnotations
(Simplifier.Annotation);
Shared\Extensions\SyntaxGeneratorExtensions.cs (6)
63
s => s.
WithAdditionalAnnotations
(Simplifier.Annotation));
182
factory.IdentifierName(parameter.Name))).
WithAdditionalAnnotations
(Simplifier.AddImportsAnnotation);
248
.
WithAdditionalAnnotations
(Simplifier.Annotation);
613
through.
WithAdditionalAnnotations
(Simplifier.Annotation));
632
through = through.
WithAdditionalAnnotations
(Simplifier.Annotation);
636
return through.
WithAdditionalAnnotations
(Simplifier.Annotation);
Shared\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (3)
36
statements = statements.SelectAsArray(s => s.
WithAdditionalAnnotations
(statementAnnotation));
67
statements = statements.SelectAsArray(s => s.
WithAdditionalAnnotations
(statementAnnotation));
224
.
WithAdditionalAnnotations
(Simplification.Simplifier.Annotation);
Simplification\AbstractSimplificationService.cs (2)
243
var newRoot = root.ReplaceNode(nodeOrToken.AsNode()!, currentNode.
WithAdditionalAnnotations
(marker));
300
return root.ReplaceNodes(importsToSimplify, (o, r) => r.
WithAdditionalAnnotations
(removeIfUnusedAnnotation));
SimplificationHelpers.cs (1)
35
to = to.
WithAdditionalAnnotations
(DontSimplifyAnnotation);
SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
226
factory.IdentifierName(member.Name)).
WithAdditionalAnnotations
(Simplification.Simplifier.Annotation);
SyntaxGeneratorExtensions_Negate.cs (2)
500
.
WithAdditionalAnnotations
(Simplifier.Annotation);
544
.
WithAdditionalAnnotations
(Simplifier.Annotation);
SyntaxNodeExtensions.cs (1)
310
return root.ReplaceNodes(tokenMap.Keys, (o, n) => o.
WithAdditionalAnnotations
(tokenMap[o]));
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
CodeCleanup\CodeCleanupTests.cs (2)
138
document = document.WithSyntaxRoot((await document.GetSyntaxRootAsync()).
WithAdditionalAnnotations
(annotation));
151
document = document.WithSyntaxRoot((await document.GetSyntaxRootAsync()).
WithAdditionalAnnotations
(annotation));
SerializationTests.cs (1)
73
var rootWithAnnotation = root.
WithAdditionalAnnotations
(annotation);
SolutionTests\SolutionTests.cs (4)
2543
var annotatedRoot = root.
WithAdditionalAnnotations
(annotation);
2795
tree = tree.
WithAdditionalAnnotations
(new SyntaxAnnotation("test"));
3055
var newRoot = doc.GetSyntaxRootAsync().Result.
WithAdditionalAnnotations
(SyntaxAnnotation.ElasticAnnotation);
4308
var newRoot = root.
WithAdditionalAnnotations
(new SyntaxAnnotation());
WorkspaceTests\AdhocWorkspaceTests.cs (1)
369
var newRoot = root.
WithAdditionalAnnotations
(new SyntaxAnnotation());
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\SnippetExpansionClient.cs (1)
169
newUsings.Add(candidateUsing.
WithAdditionalAnnotations
(Formatter.Annotation).WithAppendedTrailingTrivia(SyntaxFactory.CarriageReturnLineFeed));
Microsoft.VisualStudio.LanguageServices.Implementation (3)
CodeModel\AbstractCodeModelService.cs (3)
1073
node = node.
WithAdditionalAnnotations
(annotation);
1078
node = node.
WithAdditionalAnnotations
(Simplifier.Annotation);
1126
var annotatedNode = newNode.
WithAdditionalAnnotations
(annotation, Simplifier.Annotation);
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\SnippetExpansionClient.vb (1)
204
importsToAdd.Add(filteredImportsStatement.
WithAdditionalAnnotations
(Formatter.Annotation) _