321 references to Annotation
IdeCoreBenchmarks (2)
FormatterBenchmarks.cs (2)
54var root = document.GetSyntaxRootAsync(CancellationToken.None).Result.WithAdditionalAnnotations(Formatter.Annotation); 69var formattedDoc = Formatter.FormatAsync(_document, Formatter.Annotation, _options, CancellationToken.None).Result;
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Helpers\CodeFixVerifier.Helper.cs (1)
82root = Formatter.Format(root, Formatter.Annotation, simplifiedDoc.Project.Solution.Workspace);
Verifiers\CodeFixVerifier.cs (1)
109document = document.WithSyntaxRoot(Formatter.Format(document.GetSyntaxRootAsync().Result, Formatter.Annotation, document.Project.Solution.Workspace));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Helpers\CodeFixVerifier.Helper.cs (1)
82root = Formatter.Format(root, Formatter.Annotation, simplifiedDoc.Project.Solution.Workspace);
Verifiers\CodeFixVerifier.cs (1)
109document = document.WithSyntaxRoot(Formatter.Format(document.GetSyntaxRootAsync().Result, Formatter.Annotation, document.Project.Solution.Workspace));
Microsoft.CodeAnalysis.CodeStyle.Fixes (23)
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
133.WithAdditionalAnnotations(Formatter.Annotation, s_annotation);
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121var newRoot = root.ReplaceNode(docCommentNode, newDocComment.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
63localStatement = localStatement.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 (1)
199.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
38switchNode, switchExpression).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
39switchNode, switchOperation).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
418.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 433.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (1)
88return coalesceExpression.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
211.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
88var newStatement = GetNewStatement(statement, objectCreation, formattingOptions, matches).WithAdditionalAnnotations(Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
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 (1)
102.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (4)
129declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); 143newNextStatement.WithAdditionalAnnotations(Formatter.Annotation).WithLeadingTrivia( 153(current, generator) => current.WithAdditionalAnnotations(Formatter.Annotation).WithPrependedLeadingTrivia( 173declarationStatement.WithAdditionalAnnotations(Formatter.Annotation));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (48)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (2)
63(c, _) => c.WithAdditionalAnnotations(Formatter.Annotation)); 83.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
103editor.ReplaceNode(switchStatement, switchExpressionStatement.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
269node.Expression.Cast(expressionConvertedType).WithAdditionalAnnotations(Formatter.Annotation),
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
434.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (3)
171.WithAdditionalAnnotations(Formatter.Annotation)); 204(t, g) => t.WithTrailingTrivia(ElasticSpace).WithoutAnnotations(Formatter.Annotation)); 305newType = newType.WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
105newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation); 141newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
77.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
119var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (2)
196.Select(d => d.WithAdditionalAnnotations(Formatter.Annotation, s_warningAnnotation)); 228.Select(directive => directive.WithAdditionalAnnotations(Formatter.Annotation, s_warningAnnotation));
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
65? node.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (1)
73return castExpression.Uncast().WithAdditionalAnnotations(Formatter.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\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (1)
72.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
166return proposedReplacementNode.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
86.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
33return newCreation.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
75.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
51.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
38.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (2)
71editor.ReplaceNode(accessorList, (current, _) => current.WithAdditionalAnnotations(Formatter.Annotation)); 86.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
23=> UpdateWorker(semanticModel, lambdaExpression, cancellationToken).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
89var 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)
85var patternSyntax = AsPatternSyntax(pattern).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
120.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
95return newIf.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (3)
162a => a.WithTarget(AttributeTargetSpecifier(MethodKeyword)).WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation))); 175.WithAdditionalAnnotations(Formatter.Annotation)); 482UpdateDeclaration(declaration, assignmentExpression, expressionStatement).WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
123newDocComment = newDocComment.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
131result[i] = result[i].WithAdditionalAnnotations(Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
32? result.WithAdditionalAnnotations(Formatter.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
104return SyntaxFactory.Token(leadingTrivia, kind, trailingTrivia).WithAdditionalAnnotations(Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
236.WithAdditionalAnnotations(Formatter.Annotation); 257.WithAdditionalAnnotations(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (2)
99.WithAdditionalAnnotations(Formatter.Annotation); 109braces.closeBrace.WithAdditionalAnnotations(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
222(currentBlock, _) => currentBlock.WithAdditionalAnnotations(Formatter.Annotation)); 280.WithAdditionalAnnotations(Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (1)
85tokenWithLeadingWhitespace = token.WithLeadingTrivia(SyntaxFactory.ElasticMarker).WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
215simplifiedDocument, Formatter.Annotation, cleanupOptions.FormattingOptions, cancellationToken).ConfigureAwait(false); 280.WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.Features (84)
AddImport\CSharpAddImportFeatureService.cs (2)
434.WithAdditionalAnnotations(Formatter.Annotation), 487.WithAdditionalAnnotations(Formatter.Annotation);
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (1)
65var titleComment = Comment(string.Format(" // {0}", title)).WithAdditionalAnnotations(Formatter.Annotation);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (3)
306newLocalDeclaration.WithAdditionalAnnotations(Formatter.Annotation)); 338.WithAdditionalAnnotations(Formatter.Annotation); 375expressionToInline = expressionToInline.WithAdditionalAnnotations(Formatter.Annotation);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (2)
158return replacement.ConvertToSingleLine().WithAdditionalAnnotations(Formatter.Annotation); 209return rewrittenPattern.ConvertToSingleLine().WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation);
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
101.WithAdditionalAnnotations(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (1)
138.WithAdditionalAnnotations(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (2)
98CreateDefaultStatement(queryOrLinqInvocationExpression, _modifyingExpression).WithAdditionalAnnotations(Formatter.Annotation)); 185SyntaxFactory.IdentifierName(MethodName))).WithAdditionalAnnotations(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (1)
41.WithAdditionalAnnotations(Formatter.Annotation));
ConvertLinq\ConvertForEachToLinqQuery\YieldReturnConverter.cs (1)
38SyntaxFactory.ReturnStatement(queryOrLinqInvocationExpression).WithAdditionalAnnotations(Formatter.Annotation));
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (2)
700forEachStatement.Statement).WithAdditionalAnnotations(Formatter.Annotation), queryExpressionProcessingInfo); 722expression => forEachStatement.Statement.WithAdditionalAnnotations(Formatter.Annotation),
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
472[.. methodTargetingAttributes.Select(a => a.WithTarget(null).WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation))],
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (1)
131var statement = globalStatement.Statement.WithAdditionalAnnotations(Formatter.Annotation);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
232globalStatements.Add(GlobalStatement(statement).WithAdditionalAnnotations(Formatter.Annotation));
Copilot\CSharpCopilotCodeFixProvider.cs (1)
129.WithAdditionalAnnotations(Formatter.Annotation, WarningAnnotation);
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
77.WithAdditionalAnnotations(Formatter.Annotation)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
110Formatter.Annotation.AddAnnotationToSymbol(methodSymbol)); 133return container.CopyAnnotationsTo(callSiteGenerator.Generate()).WithAdditionalAnnotations(Formatter.Annotation);
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
212declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation);
GenerateType\CSharpGenerateTypeService.cs (1)
752var addedCompilationRoot = compilationRoot.AddUsingDirectives([usingDirective], addImportOptions.PlaceSystemNamespaceFirst, Formatter.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
53EqualsValueClause(expression.WithoutTrivia()))])).WithAdditionalAnnotations(Formatter.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (5)
127.WithAdditionalAnnotations(Formatter.Annotation); 255.WithAdditionalAnnotations(Formatter.Annotation); 292declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); 360declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); 397Block(root.GetCurrentNode(statement)).WithAdditionalAnnotations(Formatter.Annotation));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (1)
38expression).WithAdditionalAnnotations(Formatter.Annotation);
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
177: updatedIf.WithAdditionalAnnotations(Formatter.Annotation);
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (5)
155return property.WithAdditionalAnnotations(Formatter.Annotation); 189.WithAdditionalAnnotations(Formatter.Annotation); 202.WithAdditionalAnnotations(Formatter.Annotation); 228return accessor.WithBody(getMethodDeclaration.Body.WithAdditionalAnnotations(Formatter.Annotation)); 277return accessor.WithBody(body.WithAdditionalAnnotations(Formatter.Annotation));
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (4)
140.WithAdditionalAnnotations(Formatter.Annotation); 211.WithAdditionalAnnotations(Formatter.Annotation); 266.WithAdditionalAnnotations(Formatter.Annotation); 277.WithAdditionalAnnotations(Formatter.Annotation);
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
356return expr.WithAdditionalAnnotations(Formatter.Annotation);
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.cs (1)
55Simplifier.Annotation, Formatter.Annotation, DoNotAllowVarAnnotation.Annotation);
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (2)
63(c, _) => c.WithAdditionalAnnotations(Formatter.Annotation)); 83.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
103editor.ReplaceNode(switchStatement, switchExpressionStatement.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
269node.Expression.Cast(expressionConvertedType).WithAdditionalAnnotations(Formatter.Annotation),
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
434.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (3)
171.WithAdditionalAnnotations(Formatter.Annotation)); 204(t, g) => t.WithTrailingTrivia(ElasticSpace).WithoutAnnotations(Formatter.Annotation)); 305newType = newType.WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
105newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation); 141newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
77.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
119var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (2)
196.Select(d => d.WithAdditionalAnnotations(Formatter.Annotation, s_warningAnnotation)); 228.Select(directive => directive.WithAdditionalAnnotations(Formatter.Annotation, s_warningAnnotation));
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
65? node.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (1)
73return castExpression.Uncast().WithAdditionalAnnotations(Formatter.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\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (1)
72.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
166return proposedReplacementNode.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
86.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
33return newCreation.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
75.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
51.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
38.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (2)
71editor.ReplaceNode(accessorList, (current, _) => current.WithAdditionalAnnotations(Formatter.Annotation)); 86.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
23=> UpdateWorker(semanticModel, lambdaExpression, cancellationToken).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
89var 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)
85var patternSyntax = AsPatternSyntax(pattern).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
120.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
95return newIf.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (3)
162a => a.WithTarget(AttributeTargetSpecifier(MethodKeyword)).WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation))); 175.WithAdditionalAnnotations(Formatter.Annotation)); 482UpdateDeclaration(declaration, assignmentExpression, expressionStatement).WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
123newDocComment = newDocComment.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
131result[i] = result[i].WithAdditionalAnnotations(Formatter.Annotation);
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (1)
182.WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.Workspaces (14)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3115block = block.WithOpenBraceToken(block.OpenBraceToken.WithAdditionalAnnotations(Formatter.Annotation));
Simplification\CSharpSimplificationService.cs (1)
166tokenWithLeadingWhitespace = token.WithLeadingTrivia(SyntaxFactory.ElasticMarker).WithAdditionalAnnotations(Formatter.Annotation);
Simplification\CSharpSimplificationService.Expander.cs (1)
1126.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
Simplification\Reducers\CSharpNameReducer.cs (1)
61node = node.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Formatter.Annotation);
Simplification\Reducers\CSharpNameReducer.Rewriter.cs (1)
223return result.Parenthesize().WithAdditionalAnnotations(Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
32? result.WithAdditionalAnnotations(Formatter.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
104return SyntaxFactory.Token(leadingTrivia, kind, trailingTrivia).WithAdditionalAnnotations(Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
236.WithAdditionalAnnotations(Formatter.Annotation); 257.WithAdditionalAnnotations(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (2)
99.WithAdditionalAnnotations(Formatter.Annotation); 109braces.closeBrace.WithAdditionalAnnotations(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
222(currentBlock, _) => currentBlock.WithAdditionalAnnotations(Formatter.Annotation)); 280.WithAdditionalAnnotations(Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (1)
85tokenWithLeadingWhitespace = token.WithLeadingTrivia(SyntaxFactory.ElasticMarker).WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
CodeGeneration\SymbolEditorTests.cs (1)
57document = await Formatter.FormatAsync(document, Formatter.Annotation, CSharpSyntaxFormattingOptions.Default, CancellationToken.None);
Formatting\FormattingElasticTriviaTests.cs (2)
112var newDecl = generator.AddAttributes(decl, generator.Attribute("Some")).WithAdditionalAnnotations(Formatter.Annotation); 135var annotationFormatted = Formatter.Format(newRoot, Formatter.Annotation, workspace.Services.SolutionServices, options, CancellationToken.None).ToFullString();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeGeneration\CodeGenerationTests.cs (4)
542.WithAdditionalAnnotations(Formatter.Annotation); 561.WithAdditionalAnnotations(Formatter.Annotation); 613updatedDeclarationNode = updatedDeclarationNode.WithAdditionalAnnotations(Formatter.Annotation); 960var actual = Formatter.FormatAsync(simplified, Formatter.Annotation, formattingOptions, CancellationToken.None).Result.GetSyntaxRootAsync().Result.ToFullString();
Microsoft.CodeAnalysis.Features (55)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (1)
60.WithAdditionalAnnotations(Formatter.Annotation);
ChangeSignature\AbstractChangeSignatureService.cs (2)
526newArguments.Add(argument.WithName(param.Name).WithAdditionalAnnotations(Formatter.Annotation)); 549newArguments.Add(paramsArrayArgument.WithName(param.Name).WithAdditionalAnnotations(Formatter.Annotation));
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (4)
414import = import.WithAdditionalAnnotations(Formatter.Annotation); 628root = root.WithAdditionalAnnotations(Formatter.Annotation); 632root = Formatter.Format(root, Formatter.Annotation, services, documentOptions.FormattingOptions, cancellationToken); 669var formattedDocument = await Formatter.FormatAsync(documentWithAdditionalImports, Formatter.Annotation, documentOptions.FormattingOptions, cancellationToken)
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
222document = await Formatter.FormatAsync(document, Formatter.Annotation, cleanupOptions.FormattingOptions, cancellationToken).ConfigureAwait(false);
Completion\Providers\ImportCompletionProvider\ImportCompletionProviderHelpers.cs (2)
37var importNode = syntaxGenerator.NamespaceImportDeclaration(namespaceName).WithAdditionalAnnotations(Formatter.Annotation); 47var formattedDocumentWithImport = await Formatter.FormatAsync(documentWithImport, Formatter.Annotation, formattingOptions, cancellationToken).ConfigureAwait(false);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
238.WithAdditionalAnnotations(Formatter.Annotation);
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
133return ConvertToTuple(anonCreation).WithAdditionalAnnotations(Formatter.Annotation);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
98editor.ReplaceNode(property, fullProperty.WithAdditionalAnnotations(Formatter.Annotation));
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (2)
100return foreachCollectionExpression.WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation); 146return (TStatementSyntax)localDecl.WithAdditionalAnnotations(Formatter.Annotation);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
50.WithAdditionalAnnotations(Formatter.Annotation)
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
317syntaxFacts.ConvertToSingleLine(expressions[index], useElasticTrivia: true).WithAdditionalAnnotations(Formatter.Annotation));
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
713.WithAdditionalAnnotations(Formatter.Annotation);
EncapsulateField\AbstractEncapsulateFieldService.cs (3)
201document = await Formatter.FormatAsync(document.WithSyntaxRoot(rewrittenFieldDeclaration), Formatter.Annotation, formattingOptions, cancellationToken).ConfigureAwait(false); 223documentWithProperty = await Formatter.FormatAsync(documentWithProperty, Formatter.Annotation, formattingOptions, cancellationToken).ConfigureAwait(false); 359Formatter.Annotation.AddAnnotationToSymbol(propertySymbol));
ExtractInterface\AbstractExtractInterfaceService.cs (2)
298Formatter.Annotation, 349var unformattedTypeDeclaration = syntaxGenerator.AddInterfaceType(typeDeclaration, typeReference).WithAdditionalAnnotations(Formatter.Annotation);
ExtractMethod\MethodExtractor.cs (1)
159Formatter.Format(simplifiedRoot, Formatter.Annotation, services, this.Options.CodeCleanupOptions.FormattingOptions, formattingRules, cancellationToken));
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
562syntaxGenerator.AddParentheses(inlineMethodContext.InlineExpression.WithAdditionalAnnotations(Formatter.Annotation))));
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
517updatedExpression.WithAdditionalAnnotations(Formatter.Annotation), parameterName, insertionIndex, named);
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (3)
181newParent.WithAdditionalAnnotations(Formatter.Annotation))); 261newParent.WithAdditionalAnnotations(Formatter.Annotation))); 270usingStatement.WithAdditionalAnnotations(Formatter.Annotation)));
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (5)
510return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 534return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 560return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 583return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 608return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation));
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
80token.Parent.ReplaceToken(token, default(SyntaxToken)).WithAdditionalAnnotations(Formatter.Annotation)));
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
83var reformatSnippetNode = snippetExpressionNode.WithAdditionalAnnotations(FindSnippetAnnotation, Simplifier.Annotation, SymbolAnnotation.Create(consoleSymbol!), Formatter.Annotation);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
215var reformatSnippetNode = snippetExpressionNode.WithAdditionalAnnotations(FindSnippetAnnotation, Simplifier.Annotation, Formatter.Annotation);
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (1)
91newCondition = newCondition.WithAdditionalAnnotations(Formatter.Annotation);
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
67leftCondition = leftCondition.WithAdditionalAnnotations(Formatter.Annotation); 68rightCondition = rightCondition.WithAdditionalAnnotations(Formatter.Annotation);
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (1)
85return root.ReplaceNode(outerIfOrElseIf, newIfOrElseIf.WithAdditionalAnnotations(Formatter.Annotation));
SplitOrMergeIfStatements\Nested\AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider.cs (1)
57root.ReplaceNode(ifOrElseIf, outerIfOrElseIf.WithAdditionalAnnotations(Formatter.Annotation)));
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
133.WithAdditionalAnnotations(Formatter.Annotation, s_annotation);
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121var newRoot = root.ReplaceNode(docCommentNode, newDocComment.WithAdditionalAnnotations(Formatter.Annotation));
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
63localStatement = localStatement.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 (1)
199.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
38switchNode, switchExpression).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
39switchNode, switchOperation).WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
418.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 433.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (1)
88return coalesceExpression.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
211.WithAdditionalAnnotations(Formatter.Annotation);
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
88var newStatement = GetNewStatement(statement, objectCreation, formattingOptions, matches).WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (12)
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (2)
100.WithAdditionalAnnotations(Formatter.Annotation) 105.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
42Dim yieldStatement = SyntaxFactory.YieldStatement(returnStatement.Expression).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (2)
113Dim iteratorToken As SyntaxToken = Token(SyntaxKind.IteratorKeyword).WithAdditionalAnnotations(Formatter.Annotation) 132Dim iteratorToken As SyntaxToken = Token(SyntaxKind.IteratorKeyword).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
107Dim newCastExpression = Uncast(castExpression).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedValuesCodeFixProvider.vb (1)
71Return proposedReplacementNode.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
69Dim result = newStatement.WithLeadingTrivia(totalTrivia).WithAdditionalAnnotations(Formatter.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (3)
94Return SyntaxFactory.EndClassStatement().WithAdditionalAnnotations(Formatter.Annotation) 96Return SyntaxFactory.EndInterfaceStatement().WithAdditionalAnnotations(Formatter.Annotation) 98Return SyntaxFactory.EndStructureStatement().WithAdditionalAnnotations(Formatter.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (1)
44newRoot = newRoot.WithAdditionalAnnotations(Formatter.Annotation)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (1)
75Formatter.Annotation,
Utilities\CommandHandlers\AbstractImplementAbstractClassOrInterfaceCommandHandler.vb (1)
189newDocument = Await Formatter.FormatAsync(newDocument, Formatter.Annotation, cleanupOptions.FormattingOptions, cancellationToken).ConfigureAwait(True)
Microsoft.CodeAnalysis.VisualBasic.Features (36)
AddImport\VisualBasicAddImportFeatureService.vb (1)
303newRoot = newRoot.WithAdditionalAnnotations(CaseCorrector.Annotation, Formatter.Annotation)
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (3)
195Dim updatedDocument = Await document.ReplaceNodeAsync(node, updatedProperty.WithAdditionalAnnotations(Formatter.Annotation), cancellationToken).ConfigureAwait(False) 222Dim updatedDocument = Await document.ReplaceNodeAsync(endStatement.Parent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation), cancellationToken).ConfigureAwait(False) 257updatedDocument = Await updatedDocument.ReplaceNodeAsync(tree, tree.WithAdditionalAnnotations(Formatter.Annotation), cancellationToken).ConfigureAwait(False)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (2)
206.WithAdditionalAnnotations(Formatter.Annotation) 225.WithAdditionalAnnotations(Formatter.Annotation)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (1)
79Return newNode.WithAdditionalAnnotations(Formatter.Annotation)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (1)
67Dim titleComment = SyntaxFactory.CommentTrivia(String.Format(" ' {0}", title)).WithAdditionalAnnotations(Formatter.Annotation)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.ReferenceRewriter.vb (1)
61.WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (4)
196updatedDocument = Await updatedDocument.ReplaceNodeAsync(scope, newScope.WithAdditionalAnnotations(Formatter.Annotation), cancellationToken).ConfigureAwait(False) 282.WithAdditionalAnnotations(Formatter.Annotation) 313.WithAdditionalAnnotations(Formatter.Annotation) 325.WithAdditionalAnnotations(Formatter.Annotation)
EncapsulateField\VisualBasicEncapsulateFieldService.vb (2)
49root = root.ReplaceNode(fieldIdentifier, fieldIdentifier.WithIdentifier(newIdentifier).WithAdditionalAnnotations(annotation, Formatter.Annotation)) 61.WithAdditionalAnnotations(Formatter.Annotation)
ExtractInterface\VisualBasicExtractInterfaceService.vb (2)
75Return implementsClause.AddInterfaceMembers(qualifiedName).WithAdditionalAnnotations(Formatter.Annotation) 77Return SyntaxFactory.ImplementsClause(qualifiedName).WithAdditionalAnnotations(Formatter.Annotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (2)
91Formatter.Annotation.AddAnnotationToSymbol(methodSymbol)) 114Return container.CopyAnnotationsTo(callSiteGenerator.Generate()).WithAdditionalAnnotations(Formatter.Annotation)
GenerateType\VisualBasicGenerateTypeService.vb (1)
664Dim addedCompilationRoot = compilationRoot.AddImportsStatement(newImport, addImportOptions.PlaceSystemNamespaceFirst, Formatter.Annotation, Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (1)
215.WithAdditionalAnnotations(Formatter.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceLocal.vb (4)
95SyntaxFactory.EndFunctionStatement()).WithAdditionalAnnotations(Formatter.Annotation) 128declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation, localAnnotation) 150Dim finalInnerMostBlock = oldInnerMostCommonBlock.ReplaceStatements(statements, Formatter.Annotation) 176Dim newRoot = tree.ConvertSingleLineToMultiLineExecutableBlock(oldBlock, statements, Formatter.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceQueryLocal.vb (1)
30expression)).WithAdditionalAnnotations(Formatter.Annotation)
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (1)
129Return newPropertyDeclaration.WithAdditionalAnnotations(Formatter.Annotation)
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (1)
109Return statement.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (2)
100.WithAdditionalAnnotations(Formatter.Annotation) 105.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
42Dim yieldStatement = SyntaxFactory.YieldStatement(returnStatement.Expression).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (2)
113Dim iteratorToken As SyntaxToken = Token(SyntaxKind.IteratorKeyword).WithAdditionalAnnotations(Formatter.Annotation) 132Dim iteratorToken As SyntaxToken = Token(SyntaxKind.IteratorKeyword).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
107Dim newCastExpression = Uncast(castExpression).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedValuesCodeFixProvider.vb (1)
71Return proposedReplacementNode.WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
69Dim result = newStatement.WithLeadingTrivia(totalTrivia).WithAdditionalAnnotations(Formatter.Annotation)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (6)
Simplification\Reducers\VisualBasicNameReducer.vb (1)
48node = node.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Formatter.Annotation)
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
45replacementNode = node.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Formatter.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (3)
94Return SyntaxFactory.EndClassStatement().WithAdditionalAnnotations(Formatter.Annotation) 96Return SyntaxFactory.EndInterfaceStatement().WithAdditionalAnnotations(Formatter.Annotation) 98Return SyntaxFactory.EndStructureStatement().WithAdditionalAnnotations(Formatter.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (1)
44newRoot = newRoot.WithAdditionalAnnotations(Formatter.Annotation)
Microsoft.CodeAnalysis.Workspaces (13)
CodeActions\CodeAction.cs (1)
472/// Formatting nodes annotated with <see cref="Formatter.Annotation"/>
CodeActions\CodeAction_Cleanup.cs (1)
52var document1 = await Formatter.FormatAsync(document, Formatter.Annotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false);
Rename\ConflictEngine\RenamedSpansTracker.cs (1)
159document = await Formatter.FormatAsync(document, Formatter.Annotation, cleanupOptions.FormattingOptions, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
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 (1)
102.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (4)
129declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); 143newNextStatement.WithAdditionalAnnotations(Formatter.Annotation).WithLeadingTrivia( 153(current, generator) => current.WithAdditionalAnnotations(Formatter.Annotation).WithPrependedLeadingTrivia( 173declarationStatement.WithAdditionalAnnotations(Formatter.Annotation));
Microsoft.VisualStudio.LanguageServices (1)
Venus\ContainedLanguageCodeSupport.cs (1)
231Formatter.Annotation,
Microsoft.VisualStudio.LanguageServices.CSharp (2)
Snippets\CSharpSnippetExpansionLanguageHelper.cs (2)
101var formattedDocument = await Formatter.FormatAsync(newDocument, Formatter.Annotation, formattingOptions, cancellationToken).ConfigureAwait(true); 143newUsings.Add(candidateUsing.WithAdditionalAnnotations(Formatter.Annotation).WithAppendedTrailingTrivia(SyntaxFactory.CarriageReturnLineFeed));
Microsoft.VisualStudio.LanguageServices.VisualBasic (7)
CodeModel\VisualBasicCodeModelService.vb (5)
1331Dim newDeclarator = declarator.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1344Dim newDeclaration = declaration.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1372Dim newArgumentList = argumentList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1379Dim newParameterList = parameterList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 3939.WithAdditionalAnnotations(Formatter.Annotation)
Snippets\VisualBasicSnippetExpansionLanguageHelper.vb (2)
70Dim formattedDocument = Await Formatter.FormatAsync(newDocument, Formatter.Annotation, formattingOptions, cancellationToken).ConfigureAwait(True) 160importsToAdd.Add(filteredImportsStatement.WithAdditionalAnnotations(Formatter.Annotation) _
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (1)
144.WithAdditionalAnnotations(Formatter.Annotation);
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (2)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (2)
155WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation) 160WithAdditionalAnnotations(Formatter.Annotation)