646 references to WithAdditionalAnnotations
IdeCoreBenchmarks (1)
FormatterBenchmarks.cs (1)
54var root = document.GetSyntaxRootAsync(CancellationToken.None).Result.WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis (1)
Syntax\SyntaxNodeExtensions_Tracking.cs (1)
53return root.ReplaceNodes(nodes, (n, r) => n.HasAnnotation(GetId(n)!) ? r : r.WithAdditionalAnnotations(GetId(n)!));
Microsoft.CodeAnalysis.CodeStyle (3)
AbstractSpeculationAnalyzer.cs (1)
186var annotatedExpression = _newExpressionForReplace.WithAdditionalAnnotations(annotation);
AnnotationTable.cs (1)
81=> node.WithAdditionalAnnotations(this.GetOrCreateRealAnnotations(annotations).ToArray());
SyntaxNodeExtensions.cs (1)
310return root.ReplaceNodes(tokenMap.Keys, (o, n) => o.WithAdditionalAnnotations(tokenMap[o]));
Microsoft.CodeAnalysis.CodeStyle.Fixes (44)
AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121var newRoot = root.ReplaceNode(docCommentNode, newDocComment.WithAdditionalAnnotations(Formatter.Annotation));
AbstractAddExplicitCastCodeFixProvider.cs (2)
132.WithAdditionalAnnotations(Simplifier.Annotation)); 139this.Cast(targetNode, conversionType).WithAdditionalAnnotations(Simplifier.Annotation));
AbstractCodeGenerationService.cs (1)
73? node.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
AbstractForEachCastCodeFixProvider.cs (1)
79rewritten = rewritten.WithAdditionalAnnotations(
AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
93.WithAdditionalAnnotations(Formatter.Annotation);
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
104.WithAdditionalAnnotations(Formatter.Annotation, annotation);
AbstractMoveDeclarationNearReferenceService.cs (6)
127: explicitDeclarationStatement.WithAdditionalAnnotations(warningAnnotation); 128declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); 142newNextStatement.WithAdditionalAnnotations(Formatter.Annotation).WithLeadingTrivia( 152(current, generator) => current.WithAdditionalAnnotations(Formatter.Annotation).WithPrependedLeadingTrivia( 164: declarationStatement.WithAdditionalAnnotations(warningAnnotation); 172declarationStatement.WithAdditionalAnnotations(Formatter.Annotation));
AbstractPopulateSwitchCodeFixProvider.cs (2)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation) 199.WithAdditionalAnnotations(Formatter.Annotation);
AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
38switchNode, switchExpression).WithAdditionalAnnotations(Formatter.Annotation);
AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
39switchNode, switchOperation).WithAdditionalAnnotations(Formatter.Annotation);
AbstractRemoveUnusedValuesCodeFixProvider.cs (7)
268root = root.ReplaceNodes(memberDeclarations, computeReplacementNode: (_, n) => n.WithAdditionalAnnotations(s_memberAnnotation)); 407.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 422.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 577declarationStatement = declarationStatement.WithAdditionalAnnotations(s_unusedLocalDeclarationAnnotation); 629nodeReplacementMap.Add(localDeclarationStatement, localDeclarationStatement.WithAdditionalAnnotations(s_existingLocalDeclarationWithoutInitializerAnnotation)); 657editor.ReplaceNode(node, replacement.WithAdditionalAnnotations(Formatter.Annotation)); 678.WithAdditionalAnnotations(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
AbstractUseCollectionInitializerCodeFixProvider.cs (1)
97.WithAdditionalAnnotations(Formatter.Annotation);
AbstractUseConditionalExpressionCodeFixProvider.cs (2)
120conditionalExpression = conditionalExpression.WithAdditionalAnnotations(Simplifier.Annotation); 126conditionalExpression = 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); 128parameterDeclaration = parameterDeclaration.WithAdditionalAnnotations(
CodeGenerationHelpers.cs (2)
43? syntax?.WithAdditionalAnnotations(codeGenerationSymbol.GetAnnotations()) 47=> node.WithAdditionalAnnotations(Formatter.Annotation, CodeGenerator.Annotation);
SimplificationHelpers.cs (1)
35to = to.WithAdditionalAnnotations(DontSimplifyAnnotation);
SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
226factory.IdentifierName(member.Name)).WithAdditionalAnnotations(Simplification.Simplifier.Annotation);
SyntaxGeneratorExtensions_Negate.cs (2)
500.WithAdditionalAnnotations(Simplifier.Annotation); 544.WithAdditionalAnnotations(Simplifier.Annotation);
UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
74coalesceExpression = coalesceExpression.WithAdditionalAnnotations(
UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (2)
88coalesceExpression = coalesceExpression.WithAdditionalAnnotations( 92return coalesceExpression.WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
AnalyzedPattern.cs (1)
56SyntaxFactory.ConstantPattern(SyntaxFactory.ParenthesizedExpression(binaryExpression.Right.WithAdditionalAnnotations(s_annotation)))
CSharpUseImplicitTypeHelper.cs (1)
199SyntaxFactory.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)
27newUsings = newUsings.Select(u => u.WithAdditionalAnnotations(annotations)).ToList();
CastExpressionSyntaxExtensions.cs (1)
31.WithAdditionalAnnotations(Simplifier.Annotation);
CompilationUnitSyntaxExtensions.cs (1)
134usings.Select(u => u.WithAdditionalAnnotations(annotations)).ToSyntaxList());
ConvertNamespaceTransform.cs (2)
98converted.WithAdditionalAnnotations(annotation)); 258semicolonToken: default).WithAdditionalAnnotations(Formatter.Annotation);
ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
107editor.ReplaceNode(switchStatement, switchExpressionStatement.WithAdditionalAnnotations(Formatter.Annotation));
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
269node.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)
159SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), newNameNode).WithAdditionalAnnotations(Simplifier.Annotation);
CSharpFixReturnTypeCodeFixProvider.cs (1)
127fixedDeclaration = fixedDeclaration.WithAdditionalAnnotations(Simplifier.Annotation).WithTriviaFrom(declarationTypeToFix);
CSharpInlineDeclarationCodeFixProvider.cs (2)
304newType = newType.WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation); 364.WithAdditionalAnnotations(annotation));
CSharpIsAndCastCheckCodeFixProvider.cs (1)
103return newIf.WithAdditionalAnnotations(Formatter.Annotation);
CSharpMakeMethodAsynchronousCodeFixProvider.cs (3)
118var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation); 154return newReturnType.WithTriviaFrom(returnTypeSyntax).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation); 162return result.WithAdditionalAnnotations(Simplifier.Annotation);
CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
67? node.WithAdditionalAnnotations(Formatter.Annotation)
CSharpRemoveUnnecessaryCastCodeFixProvider.cs (3)
74.WithAdditionalAnnotations(Simplifier.Annotation); 80return 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)
65return node.WithAdditionalAnnotations(s_annotation);
CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
79.WithAdditionalAnnotations(Formatter.Annotation);
CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (2)
47statement.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)
91var patternSyntax = AsPatternSyntax(pattern).WithAdditionalAnnotations(Formatter.Annotation); 135return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation);
CSharpUseRangeOperatorCodeFixProvider.cs (1)
92var argument = Argument(rangeExpression).WithAdditionalAnnotations(Formatter.Annotation);
ExpressionGenerator.cs (3)
289memberAccess = memberAccess.WithAdditionalAnnotations(SpecialTypeAnnotation.Create(type.SpecialType)); 293return result.WithAdditionalAnnotations(Simplifier.Annotation); 316result = result.WithAdditionalAnnotations(Simplifier.Annotation);
ExpressionSyntaxExtensions.cs (3)
49? result.WithAdditionalAnnotations(Simplifier.Annotation) 80? result.WithAdditionalAnnotations(Simplifier.Annotation) 92return castExpression.WithAdditionalAnnotations(Simplifier.Annotation);
InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
111newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation); 151newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation);
ITypeSymbolExtensions.cs (6)
27=> typeSymbol.Accept(ExpressionSyntaxGeneratorVisitor.Create(nameSyntax))!.WithAdditionalAnnotations(Simplifier.Annotation); 51.WithAdditionalAnnotations(Simplifier.Annotation); 54syntax = syntax.WithAdditionalAnnotations(DoNotAllowVarAnnotation.Annotation); 67syntax = syntax.WithAdditionalAnnotations(additionalAnnotation); 78.WithAdditionalAnnotations(Simplifier.Annotation); 88.WithAdditionalAnnotations(Simplifier.Annotation);
ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
33syntax = syntax.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol));
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
42syntax = 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)
200localFunctionWithNewParameters = 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)
73editor.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)
103result[i] = result[i].WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (4)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (2)
41rootEditor.ReplaceNode(oldNode, newNode.WithAdditionalAnnotations(s_replacementNodeAnnotation)); 68var 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)
56SyntaxFactory.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)
311return method.WithParameterList(method.ParameterList.WithParameters(updatedParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)); 317return typeWithParameters.WithParameterList(typeWithParameters.ParameterList.WithParameters(updatedParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)); 323return localFunction.WithParameterList(localFunction.ParameterList.WithParameters(updatedParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)); 329return constructor.WithParameterList(constructor.ParameterList.WithParameters(updatedParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)); 335return indexer.WithParameterList(indexer.ParameterList.WithParameters(updatedParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)); 341return delegateDeclaration.WithParameterList(delegateDeclaration.ParameterList.WithParameters(updatedParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)); 353return 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)
191currentNode = currentNode.WithAdditionalAnnotations(Simplifier.Annotation); 211currentNode = currentNode.WithAdditionalAnnotations(s_delegateToReplaceAnnotation); 249newNode = newNode.WithAdditionalAnnotations(Simplifier.Annotation);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (7)
141expressionToInline = expressionToInline.WithoutTrivia().Parenthesize().WithAdditionalAnnotations(Simplifier.Annotation, ExpressionAnnotation); 144document = await document.ReplaceNodeAsync(declarator, declarator.WithAdditionalAnnotations(DefinitionAnnotation), cancellationToken).ConfigureAwait(false); 155(o, n) => n.WithAdditionalAnnotations(ReferenceAnnotation), 201n = n.WithAdditionalAnnotations( 209n = n.WithAdditionalAnnotations( 312newLocalDeclaration.WithAdditionalAnnotations(Formatter.Annotation)); 381expressionToInline = expressionToInline.WithAdditionalAnnotations(Formatter.Annotation);
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
255.WithTriviaFrom(namespaceDecl.Name).WithAdditionalAnnotations(WarningAnnotation)) 315.WithAdditionalAnnotations(WarningAnnotation),
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (2)
140return replacement.ConvertToSingleLine().WithAdditionalAnnotations(Formatter.Annotation); 191return rewrittenPattern.ConvertToSingleLine().WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation);
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
101.WithAdditionalAnnotations(Formatter.Annotation);
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
144variableStatement = variableStatement.WithAdditionalAnnotations(CreateWarningAnnotation());
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (2)
67.WithAdditionalAnnotations(Formatter.Annotation); 141.WithAdditionalAnnotations(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (2)
105CreateDefaultStatement(queryOrLinqInvocationExpression, _modifyingExpression).WithAdditionalAnnotations(Formatter.Annotation)); 193SyntaxFactory.IdentifierName(MethodName))).WithAdditionalAnnotations(Formatter.Annotation);
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (1)
44.WithAdditionalAnnotations(Formatter.Annotation));
ConvertLinq\ConvertForEachToLinqQuery\YieldReturnConverter.cs (1)
45SyntaxFactory.ReturnStatement(queryOrLinqInvocationExpression).WithAdditionalAnnotations(Formatter.Annotation));
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (13)
124return SyntaxFactory.Block(SyntaxFactory.IfStatement(((WhereClauseSyntax)node).Condition.WithAdditionalAnnotations(Simplifier.Annotation).WithoutTrivia(), statement)); 213statement)))).WithAdditionalAnnotations(Simplifier.Annotation); 363methodSymbol.GenerateReturnTypeSyntax().WithAdditionalAnnotations(Simplifier.Annotation), 447nodesBeforeLocal = new[] { parentStatement.ReplaceNode(invocationExpression, initializer.WithAdditionalAnnotations(Simplifier.Annotation)) }; 460nodesAfterLocal = new StatementSyntax[] { parentStatement.ReplaceNode(invocationExpression, variableLocal.WithAdditionalAnnotations(Simplifier.Annotation)) }; 509nodesAfter = new[] { SyntaxFactory.ReturnStatement(variable).WithAdditionalAnnotations(Simplifier.Annotation) }; 537SyntaxFactory.EqualsValueClause(expression))))).WithAdditionalAnnotations(Simplifier.Annotation); 591returnType: returnedType.GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.Annotation), 605var localFunctionInvocation = SyntaxFactory.InvocationExpression(SyntaxFactory.IdentifierName(localFunctionToken)).WithAdditionalAnnotations(Simplifier.Annotation); 606var newParentExpressionStatement = parentStatement.ReplaceNode(_source.WalkUpParentheses(), localFunctionInvocation.WithAdditionalAnnotations(Simplifier.Annotation)); 709forEachStatement.Statement).WithAdditionalAnnotations(Formatter.Annotation), queryExpressionProcessingInfo); 731expression => forEachStatement.Statement.WithAdditionalAnnotations(Formatter.Annotation), 837statements.Add(statement.WithAdditionalAnnotations(Simplifier.Annotation));
ConvertNamespaceTransform.cs (2)
98converted.WithAdditionalAnnotations(annotation)); 258semicolonToken: default).WithAdditionalAnnotations(Formatter.Annotation);
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
93method = method.WithReturnType(method.ReturnType.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)); 134var statement = globalStatement.Statement.WithAdditionalAnnotations(Formatter.Annotation);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (2)
94directives.Add(UsingDirective(name).WithAdditionalAnnotations(annotation)); 232globalStatements.Add(GlobalStatement(statement).WithAdditionalAnnotations(Formatter.Annotation));
ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
107editor.ReplaceNode(switchStatement, switchExpressionStatement.WithAdditionalAnnotations(Formatter.Annotation));
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
269node.Expression.Cast(expressionConvertedType).WithAdditionalAnnotations(Formatter.Annotation),
ConvertToRecordEngine.cs (1)
417.WithAdditionalAnnotations(Formatter.Annotation);
CSharpAddYieldCodeFixProvider.cs (1)
81.WithAdditionalAnnotations(Formatter.Annotation);
CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
159SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), newNameNode).WithAdditionalAnnotations(Simplifier.Annotation);
CSharpFixReturnTypeCodeFixProvider.cs (1)
127fixedDeclaration = fixedDeclaration.WithAdditionalAnnotations(Simplifier.Annotation).WithTriviaFrom(declarationTypeToFix);
CSharpInlineDeclarationCodeFixProvider.cs (2)
304newType = newType.WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation); 364.WithAdditionalAnnotations(annotation));
CSharpIsAndCastCheckCodeFixProvider.cs (1)
103return newIf.WithAdditionalAnnotations(Formatter.Annotation);
CSharpMakeMethodAsynchronousCodeFixProvider.cs (3)
118var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation); 154return newReturnType.WithTriviaFrom(returnTypeSyntax).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation); 162return result.WithAdditionalAnnotations(Simplifier.Annotation);
CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
67? node.WithAdditionalAnnotations(Formatter.Annotation)
CSharpRemoveUnnecessaryCastCodeFixProvider.cs (3)
74.WithAdditionalAnnotations(Simplifier.Annotation); 80return 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)
47statement.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)
91var patternSyntax = AsPatternSyntax(pattern).WithAdditionalAnnotations(Formatter.Annotation); 135return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation);
CSharpUseRangeOperatorCodeFixProvider.cs (1)
92var argument = Argument(rangeExpression).WithAdditionalAnnotations(Formatter.Annotation);
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
61var updatedDeclarator = declarator.WithIdentifier(newIdentifier).WithAdditionalAnnotations(tempAnnotation); 81.WithAdditionalAnnotations(Formatter.Annotation)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
146return container.CopyAnnotationsTo(callSiteGenerator.Generate()).WithAdditionalAnnotations(Formatter.Annotation); 608var methodName = CreateMethodNameForInvocation().WithAdditionalAnnotations(Simplifier.Annotation);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (3)
191var callSignature = CreateCallSignature().WithAdditionalAnnotations(CallSiteAnnotation); 206.ReplaceNode(sourceNode, sourceNode.WithAdditionalAnnotations(sourceNodeAnnotation)) 207.WithAdditionalAnnotations(enclosingStatementAnnotation);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs (1)
133return Task.FromResult<SyntaxNode>(statement.WithAdditionalAnnotations(CallSiteAnnotation));
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.cs (1)
81return Task.FromResult<SyntaxNode>(statement.WithAdditionalAnnotations(CallSiteAnnotation));
FullyQualify\CSharpFullyQualifyService.cs (1)
49.WithAdditionalAnnotations(Formatter.Annotation);
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
211declarationStatement = 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); 51return newNode.WithAdditionalAnnotations(Simplifier.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (2)
40newQualifiedName = newQualifiedName.WithAdditionalAnnotations(Simplifier.Annotation); 51SyntaxFactory.EqualsValueClause(expression.WithoutTrivia()))))).WithAdditionalAnnotations(Formatter.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (4)
110.WithAdditionalAnnotations(Formatter.Annotation); 242.WithAdditionalAnnotations(Formatter.Annotation); 292declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); 329SyntaxFactory.Block(root.GetCurrentNode(statement)).WithAdditionalAnnotations(Formatter.Annotation));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (1)
38expression).WithAdditionalAnnotations(Formatter.Annotation);
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
178: updatedIf.WithAdditionalAnnotations(Formatter.Annotation);
InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
111newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation); 151newStatement = newStatement.WithAdditionalAnnotations(Formatter.Annotation);
MakeLocalFunctionStaticCodeFixHelper.cs (1)
200localFunctionWithNewParameters = 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)
152return property.WithAdditionalAnnotations(Formatter.Annotation); 185.WithAdditionalAnnotations(Formatter.Annotation); 198.WithAdditionalAnnotations(Formatter.Annotation); 224return accessor.WithBody(getMethodDeclaration.Body.WithAdditionalAnnotations(Formatter.Annotation)); 273return 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)
354return expr.WithAdditionalAnnotations(Formatter.Annotation);
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.cs (2)
54var annotatedexpressionSyntax = expressionSyntax.WithAdditionalAnnotations( 60annotatedexpressionSyntax = annotatedexpressionSyntax.ReplaceNode(right, right.WithAdditionalAnnotations(Simplifier.Annotation));
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
104var newRoot = root.ReplaceNode(originalTypeDeclaration, newTypeDeclaration.WithAdditionalAnnotations(_cursorAnnotation, _findSnippetAnnotation));
SplitStringLiteral\InterpolatedStringSplitter.cs (1)
82rightExpression.WithAdditionalAnnotations(RightNodeAnnotation));
SplitStringLiteral\SimpleStringSplitter.cs (1)
78rightExpression.WithAdditionalAnnotations(RightNodeAnnotation));
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
81return updatedProperty.WithTrailingTrivia(trailingTrivia).WithAdditionalAnnotations(SpecializedFormattingAnnotation);
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (1)
186.WithAdditionalAnnotations(Formatter.Annotation);
UseExpressionBodyCodeFixProvider.cs (2)
73editor.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)
103result[i] = result[i].WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (13)
Syntax\SerializationTests.cs (6)
66var root = tree.GetCompilationUnitRoot().WithAdditionalAnnotations(annotation); 90var root = tree.GetCompilationUnitRoot().WithAdditionalAnnotations(annotation, annotation); 114var root = tree.GetCompilationUnitRoot().WithAdditionalAnnotations(annotation); 143var root = tree.GetCompilationUnitRoot().WithAdditionalAnnotations(annotation1); 162var doubleAnnoRoot = droot.WithAdditionalAnnotations(annotation1, annotation2); 189var root = tree.GetCompilationUnitRoot().WithAdditionalAnnotations(annotation1, annotation1);
Syntax\SyntaxAnnotationTests.cs (6)
164var annotatedNode = node.WithAdditionalAnnotations(annotation1); 174var twiceAnnotatedNode = node2.WithAdditionalAnnotations(annotation2); 288var annotatedNode = lastChildOfFirstNode.WithAdditionalAnnotations(annotation1); 594var newNode = nodeOrToken.AsNode().WithAdditionalAnnotations(annotation); 729return base.Visit(node).WithAdditionalAnnotations(_annotation); 778return base.Visit(node).WithAdditionalAnnotations(annotation);
Syntax\SyntaxNodeTests.cs (1)
494var exprWithAnnotations = expr.ReplaceNodes(identifierNodes, (e, e2) => e2.WithAdditionalAnnotations(myAnnotation));
Microsoft.CodeAnalysis.CSharp.Workspaces (53)
BaseNamespaceDeclarationSyntaxExtensions.cs (1)
27newUsings = 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)
65return node.WithAdditionalAnnotations(s_annotation);
CSharpUseImplicitTypeHelper.cs (1)
199SyntaxFactory.IdentifierName("var").WithTriviaFrom(declarationTypeNode).WithAdditionalAnnotations(annotation));
ExpressionGenerator.cs (3)
289memberAccess = memberAccess.WithAdditionalAnnotations(SpecialTypeAnnotation.Create(type.SpecialType)); 293return result.WithAdditionalAnnotations(Simplifier.Annotation); 316result = result.WithAdditionalAnnotations(Simplifier.Annotation);
ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
33syntax = syntax.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol));
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
42syntax = syntax.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs\CompilationUnitSyntaxExtensions.cs (1)
134usings.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) 92return 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); 54syntax = syntax.WithAdditionalAnnotations(DoNotAllowVarAnnotation.Annotation); 67syntax = 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)
293newNode = newNode.WithAdditionalAnnotations(annotation);
Simplification\CSharpSimplificationService.Expander.cs (14)
186var newParameter = parameters[i].WithType(typeSyntax).WithAdditionalAnnotations(Simplifier.Annotation); 233simpleLambda.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); 711var result = newNode.WithAdditionalAnnotations(Simplifier.Annotation); 755.WithAdditionalAnnotations(Simplifier.Annotation); 978result = rewrittenNode.CopyAnnotationsTo(SyntaxFactory.QualifiedName((NameSyntax)left, right.WithAdditionalAnnotations(Simplifier.SpecialTypeAnnotation))); 1111newMemberAccess = originalNode.Expression.CopyAnnotationsTo(newMemberAccess).WithAdditionalAnnotations(Simplifier.Annotation); 1125.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (1)
58return node.WithAdditionalAnnotations(SimplificationHelpers.DontSimplifyAnnotation);
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (1)
65.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
48var newParameterSyntax = parameterSyntax.WithType(null).WithAdditionalAnnotations(annotation);
Simplification\Reducers\CSharpNameReducer.cs (1)
63node = node.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Formatter.Annotation);
Simplification\Reducers\CSharpNameReducer.Rewriter.cs (1)
223return 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)
468replacementNode = 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)
117var newDecl = generator.AddAttributes(decl, generator.Attribute("Some")).WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (2)
Snippets\CSharpSnippets\SnippetFunctions\SnippetFunctionGenerateSwitchCases.cs (1)
96var updatedRoot = syntaxRoot.ReplaceNode(nodeToReplace, nodeToReplace.WithAdditionalAnnotations(typeAnnotation, Simplifier.Annotation));
Snippets\CSharpSnippets\SnippetFunctions\SnippetFunctionSimpleTypeName.cs (1)
37var updatedRoot = syntaxRoot.ReplaceNode(nodeToReplace, nodeToReplace.WithAdditionalAnnotations(typeAnnotation, Simplifier.Annotation));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeGeneration\AbstractCodeGenerationTests.cs (1)
40root.WithAdditionalAnnotations(Simplifier.Annotation));
CodeGeneration\CodeGenerationTests.cs (3)
555.WithAdditionalAnnotations(Formatter.Annotation); 574.WithAdditionalAnnotations(Formatter.Annotation); 626updatedDeclarationNode = updatedDeclarationNode.WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (5)
Simplification\AbstractSimplificationTests.vb (4)
82root = root.ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation)) 94root = root.ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation)) 100root = root.ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation)) 106root = root.ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation))
Simplification\ParameterSimplificationTests.vb (1)
27(Await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.Features (95)
AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121var newRoot = root.ReplaceNode(docCommentNode, newDocComment.WithAdditionalAnnotations(Formatter.Annotation));
AbstractAddExplicitCastCodeFixProvider.cs (2)
132.WithAdditionalAnnotations(Simplifier.Annotation)); 139this.Cast(targetNode, conversionType).WithAdditionalAnnotations(Simplifier.Annotation));
AbstractForEachCastCodeFixProvider.cs (1)
79rewritten = rewritten.WithAdditionalAnnotations(
AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
93.WithAdditionalAnnotations(Formatter.Annotation);
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
104.WithAdditionalAnnotations(Formatter.Annotation, annotation);
AbstractPopulateSwitchCodeFixProvider.cs (2)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation) 199.WithAdditionalAnnotations(Formatter.Annotation);
AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
38switchNode, switchExpression).WithAdditionalAnnotations(Formatter.Annotation);
AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
39switchNode, switchOperation).WithAdditionalAnnotations(Formatter.Annotation);
AbstractRemoveUnusedValuesCodeFixProvider.cs (7)
268root = root.ReplaceNodes(memberDeclarations, computeReplacementNode: (_, n) => n.WithAdditionalAnnotations(s_memberAnnotation)); 407.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 422.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 577declarationStatement = declarationStatement.WithAdditionalAnnotations(s_unusedLocalDeclarationAnnotation); 629nodeReplacementMap.Add(localDeclarationStatement, localDeclarationStatement.WithAdditionalAnnotations(s_existingLocalDeclarationWithoutInitializerAnnotation)); 657editor.ReplaceNode(node, replacement.WithAdditionalAnnotations(Formatter.Annotation)); 678.WithAdditionalAnnotations(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
AbstractUseCollectionInitializerCodeFixProvider.cs (1)
97.WithAdditionalAnnotations(Formatter.Annotation);
AbstractUseConditionalExpressionCodeFixProvider.cs (2)
120conditionalExpression = conditionalExpression.WithAdditionalAnnotations(Simplifier.Annotation); 126conditionalExpression = 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)
74var updatedRoot = newRoot.WithAdditionalAnnotations(SuppressDiagnosticsAnnotation.Create());
AddParameterService.cs (2)
125.WithAdditionalAnnotations(Formatter.Annotation); 128parameterDeclaration = parameterDeclaration.WithAdditionalAnnotations(
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (1)
68var newNamespaceDeclaration = syntaxGenerator.NamespaceDeclaration(name, WithElasticTrivia(typeToMove)).WithAdditionalAnnotations(NamespaceScopeMovedAnnotation);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (5)
317documentEditor.ReplaceNode(container, container.WithAdditionalAnnotations(ContainerAnnotation)); 416import = import.WithAdditionalAnnotations(Formatter.Annotation); 628.WithAdditionalAnnotations(Formatter.Annotation); 634root = root.WithAdditionalAnnotations(Simplifier.Annotation); 736editor.ReplaceNode(oldNode, newNode.WithAdditionalAnnotations(Simplifier.Annotation));
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
113document = document.WithSyntaxRoot(newRoot.ReplaceNode(declaration, declaration.WithAdditionalAnnotations(_annotation)));
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
239return syntaxGenerator.NamespaceImportDeclaration(namespaceName).WithAdditionalAnnotations(Formatter.Annotation);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
240.WithAdditionalAnnotations(Formatter.Annotation);
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
130return ConvertToTuple(anonCreation).WithAdditionalAnnotations(Formatter.Annotation);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
101editor.ReplaceNode(property, fullProperty.WithAdditionalAnnotations(Formatter.Annotation));
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (2)
100return foreachCollectionExpression.WithoutTrivia().WithAdditionalAnnotations(Formatter.Annotation); 146return (TStatementSyntax)localDecl.WithAdditionalAnnotations(Formatter.Annotation);
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
451(node, _) => node.WithAdditionalAnnotations(
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
50.WithAdditionalAnnotations(Formatter.Annotation) 51.WithAdditionalAnnotations(Simplifier.Annotation);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
198? piece.WithAdditionalAnnotations(Simplifier.Annotation)
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
317syntaxFacts.ConvertToSingleLine(expressions[index], useElasticTrivia: true).WithAdditionalAnnotations(Formatter.Annotation));
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (3)
351fullTypeName = fullTypeName.WithAdditionalAnnotations(Simplifier.Annotation) 352.WithAdditionalAnnotations(DoNotAllowVarAnnotation.Annotation); 705.WithAdditionalAnnotations(Formatter.Annotation);
EncapsulateField\AbstractEncapsulateFieldService.cs (4)
178fieldDeclaration.GetSyntax(cancellationToken).WithAdditionalAnnotations(declarationAnnotation))); 192var updatedRoot = linkedRoot.ReplaceNode(linkedFieldNode, linkedFieldNode.WithAdditionalAnnotations(declarationAnnotation)); 418assigned.WithAdditionalAnnotations(Simplifier.Annotation), 436value.WithAdditionalAnnotations(Simplifier.Annotation));
ExtractInterface\AbstractExtractInterfaceService.cs (1)
358var unformattedTypeDeclaration = syntaxGenerator.AddInterfaceType(typeDeclaration, typeReference).WithAdditionalAnnotations(Formatter.Annotation);
ExtractMethod\MethodExtractor.CodeGenerator.cs (2)
253declarationStatement = declarationStatement.WithAdditionalAnnotations(CallSiteAnnotation); 260CreateAssignmentExpressionStatement(CreateIdentifier(variable.Name), CreateCallSignature()).WithAdditionalAnnotations(CallSiteAnnotation));
GenerateMember\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
72localStatement = localStatement.WithAdditionalAnnotations(Formatter.Annotation);
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
528updatedExpression.WithAdditionalAnnotations(Formatter.Annotation), parameterName, insertionIndex, named);
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (3)
145newParent.WithAdditionalAnnotations(Formatter.Annotation))); 174newParent.WithAdditionalAnnotations(Formatter.Annotation))); 183usingStatement.WithAdditionalAnnotations(Formatter.Annotation)));
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
393.WithAdditionalAnnotations(Formatter.Annotation);
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (5)
511return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 536return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 563return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 586return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation)); 611return root.ReplaceNode(currentParent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation));
InvertLogical\AbstractInvertLogicalCodeRefactoringProvider.cs (1)
111newBinary.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)
80token.Parent.ReplaceToken(token, default(SyntaxToken)).WithAdditionalAnnotations(Formatter.Annotation)));
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
264editor.ReplaceNode(nameToken.Parent, nameToken.Parent.WithAdditionalAnnotations( 304editor.ReplaceNode(nameToken.Parent, nameToken.Parent.WithAdditionalAnnotations(
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
329.WithAdditionalAnnotations(Simplifier.Annotation);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
271editor.ReplaceNode(parent, parent.WithAdditionalAnnotations( 276editor.ReplaceNode(parent, parent.WithAdditionalAnnotations(
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
69currentRoots[typeNode.SyntaxTree] = typeNodeRoot.ReplaceNode(typeNode, typeNode.WithAdditionalAnnotations(typeNodeAnnotation));
Shared\Utilities\ExtractTypeHelpers.cs (3)
39.WithAdditionalAnnotations(SimplificationHelpers.SimplifyModuleNameAnnotation); 42newTypeNode = newTypeNode.WithAdditionalAnnotations(typeAnnotation); 107var annotatedRoot = syntaxRoot.ReplaceNode(declarationNode, declarationNode.WithAdditionalAnnotations(typeAnnotation));
Snippets\SnippetFunctionService.cs (1)
152var updatedRoot = syntaxRoot.ReplaceNode(nodeToReplace, nodeToReplace.WithAdditionalAnnotations(typeAnnotation, Simplifier.Annotation));
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
111var reformatSnippetNode = snippetExpressionNode.WithAdditionalAnnotations(findSnippetAnnotation, cursorAnnotation, Simplifier.Annotation, SymbolAnnotation.Create(consoleSymbol!), Formatter.Annotation);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
236var reformatSnippetNode = snippetExpressionNode.WithAdditionalAnnotations(findSnippetAnnotation, cursorAnnotation, 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)));
UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
74coalesceExpression = coalesceExpression.WithAdditionalAnnotations(
UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (2)
88coalesceExpression = coalesceExpression.WithAdditionalAnnotations( 92return coalesceExpression.WithAdditionalAnnotations(Formatter.Annotation);
Wrapping\AbstractCodeActionComputer.cs (1)
244computeReplacementNode: (oldNode, newNode) => newNode.WithAdditionalAnnotations(s_toFormatAnnotation),
Microsoft.CodeAnalysis.UnitTests (1)
CommonSyntaxTests.cs (1)
240computeReplacementNode: (node, rewritten) => CSharp.SyntaxFactory.ParenthesizedExpression(rewritten).WithAdditionalAnnotations(annotation));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (6)
SpeculationAnalyzer.vb (1)
88Dim annotatedOriginalExpression = originalExpression.WithAdditionalAnnotations(originalExprAnnotation)
SyntaxNodeExtensions.vb (4)
657SyntaxFactory.EndSubStatement()).WithAdditionalAnnotations(annotations) 728.WithAdditionalAnnotations(annotations) 737.WithAdditionalAnnotations(annotations) 768SyntaxFactory.EndSubStatement()).WithAdditionalAnnotations(annotations)
VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
43Return node.WithAdditionalAnnotations(_annotation)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (21)
CompilationUnitSyntaxExtensions.vb (1)
85[imports].Select(Function(u) u.WithAdditionalAnnotations(annotations)).ToSyntaxList())
ExpressionSyntaxExtensions.vb (3)
38result.WithAdditionalAnnotations(Simplifier.Annotation), 113.WithAdditionalAnnotations(Simplifier.Annotation) 121.WithAdditionalAnnotations(Simplifier.Annotation)
ExpressionSyntaxGeneratorVisitor.vb (1)
28expression = expression.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol))
INamespaceOrTypeSymbolExtensions.vb (1)
15Return symbol.Accept(TypeSyntaxGeneratorVisitor.Create(addGlobal)).WithAdditionalAnnotations(Simplifier.Annotation)
ITypeSymbolExtensions.vb (1)
15Return typeSymbol.Accept(New ExpressionSyntaxGeneratorVisitor(addGlobal:=True)).WithAdditionalAnnotations(Simplifier.Annotation)
ParameterSyntaxExtensions.vb (1)
19Dim newParameterSyntax = parameter.WithAsClause(Nothing).WithAdditionalAnnotations(annotation)
StringExtensions.vb (1)
92Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).WithAdditionalAnnotations(Simplifier.Annotation)
TypeBlockSyntaxExtensions.vb (3)
94Return SyntaxFactory.EndClassStatement().WithAdditionalAnnotations(Formatter.Annotation) 96Return SyntaxFactory.EndInterfaceStatement().WithAdditionalAnnotations(Formatter.Annotation) 98Return SyntaxFactory.EndStructureStatement().WithAdditionalAnnotations(Formatter.Annotation)
TypeSyntaxGeneratorVisitor.vb (1)
33type = type.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol))
VisualBasicChangeToYieldCodeFixProvider.vb (1)
42Dim yieldStatement = SyntaxFactory.YieldStatement(returnStatement.Expression).WithAdditionalAnnotations(Formatter.Annotation)
VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
43WithAdditionalAnnotations(Simplifier.Annotation)
VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (2)
100.WithAdditionalAnnotations(Formatter.Annotation) 105.WithAdditionalAnnotations(Formatter.Annotation)
VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
89Dim returnType = knownTypes.TaskOfTType.Construct(methodSymbol.ReturnType).GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
108Dim newCastExpression = Uncast(castExpression).WithAdditionalAnnotations(Formatter.Annotation)
VisualBasicRemoveUnnecessaryImportsService.vb (1)
47newRoot = newRoot.WithAdditionalAnnotations(Formatter.Annotation)
VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52Return statement.ReplaceNode(declarator, declarator.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Features (60)
AddImport\VisualBasicAddImportFeatureService.vb (2)
208nameSyntax = nameSyntax.WithAdditionalAnnotations(Simplifier.Annotation) 303newRoot = newRoot.WithAdditionalAnnotations(CaseCorrector.Annotation, Formatter.Annotation)
ChangeSignature\UnifiedArgumentSyntax.vb (1)
52Return New UnifiedArgumentSyntax(_argument.WithAdditionalAnnotations(annotation))
ChangeSignature\VisualBasicChangeSignatureService.vb (10)
300Return method.WithParameterList(method.ParameterList.WithParameters(updatedParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)) 308eventStatement = eventStatement.WithParameterList(eventStatement.ParameterList.WithParameters(updatedParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)) 319Return eventBlock.WithEventStatement(eventBlock.EventStatement.WithParameterList(eventBlock.EventStatement.ParameterList.WithParameters(updatedParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation))) 326Dim updatedRaiseEventAccessor = raiseEventAccessor.WithAccessorStatement(raiseEventAccessor.AccessorStatement.WithParameterList(raiseEventAccessor.AccessorStatement.ParameterList.WithParameters(updatedParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation))) 389Return constructor.WithParameterList(constructor.ParameterList.WithParameters(newParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)) 435Return propertyStatement.WithParameterList(propertyStatement.ParameterList.WithParameters(newParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)) 460Dim newBegin = lambda.SubOrFunctionHeader.WithParameterList(lambda.SubOrFunctionHeader.ParameterList.WithParameters(newParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)) 474Dim newBegin = lambda.SubOrFunctionHeader.WithParameterList(lambda.SubOrFunctionHeader.ParameterList.WithParameters(newParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)) 482Return delegateStatement.WithParameterList(delegateStatement.ParameterList.WithParameters(newParameters).WithAdditionalAnnotations(changeSignatureFormattingAnnotation)) 518WithAdditionalAnnotations(changeSignatureFormattingAnnotation)
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)
81Return newNode.WithAdditionalAnnotations(Formatter.Annotation)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (1)
128Dim 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)
123Dim updatedDocument = Await document.ReplaceNodeAsync(modifiedIdentifier, modifiedIdentifier.WithAdditionalAnnotations(s_definitionAnnotation), cancellationToken).ConfigureAwait(False) 143Function(o, n) n.WithAdditionalAnnotations(s_referenceAnnotation), 196updatedDocument = Await updatedDocument.ReplaceNodeAsync(scope, newScope.WithAdditionalAnnotations(Formatter.Annotation), cancellationToken).ConfigureAwait(False) 282.WithAdditionalAnnotations(Formatter.Annotation) 360.WithAdditionalAnnotations(Simplifier.Annotation) 375.WithAdditionalAnnotations(s_initializerAnnotation) 401Return explicitInitializer.WithAdditionalAnnotations(s_expressionToInlineAnnotation) 466.WithAdditionalAnnotations(ConflictAnnotation.Create(VBFeaturesResources.Conflict_s_detected))
ConvertForEachToFor\VisualBasicConvertForEachToForCodeRefactoringProvider.vb (1)
146variableStatement = variableStatement.WithAdditionalAnnotations(CreateWarningAnnotation())
EncapsulateField\VisualBasicEncapsulateFieldService.vb (2)
51root = root.ReplaceNode(fieldIdentifier, fieldIdentifier.WithIdentifier(newIdentifier).WithAdditionalAnnotations(annotation, Formatter.Annotation)) 63.WithAdditionalAnnotations(Formatter.Annotation)
ExtractInterface\VisualBasicExtractInterfaceService.vb (2)
75Return implementsClause.AddInterfaceMembers(qualifiedName).WithAdditionalAnnotations(Formatter.Annotation) 77Return SyntaxFactory.ImplementsClause(qualifiedName).WithAdditionalAnnotations(Formatter.Annotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.CallSiteContainerRewriter.vb (1)
95Return node.WithAdditionalAnnotations(s_removeAnnotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.ExpressionCodeGenerator.vb (3)
120Dim callSignature = CreateCallSignature().WithAdditionalAnnotations(CallSiteAnnotation) 135.ReplaceNode(sourceNode, sourceNode.WithAdditionalAnnotations(sourceNodeAnnotation)) _ 136.WithAdditionalAnnotations(enclosingStatementAnnotation)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.MultipleStatementsCodeGenerator.vb (1)
77Return Task.FromResult(GetStatementContainingInvocationToExtractedMethodWorker().WithAdditionalAnnotations(CallSiteAnnotation))
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.SingleStatementCodeGenerator.vb (1)
66Return Task.FromResult(GetStatementContainingInvocationToExtractedMethodWorker().WithAdditionalAnnotations(CallSiteAnnotation))
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (2)
107Return container.CopyAnnotationsTo(callSiteGenerator.Generate()).WithAdditionalAnnotations(Formatter.Annotation) 330Dim methodName As ExpressionSyntax = CreateMethodNameForInvocation().WithAdditionalAnnotations(Simplifier.Annotation)
FullyQualify\VisualBasicFullyQualifyService.vb (1)
67WithAdditionalAnnotations(Formatter.Annotation, CaseCorrector.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService.Rewriter.vb (2)
29.WithAdditionalAnnotations(_replacementAnnotation) 41Return newNode.WithAdditionalAnnotations(Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (2)
34name:=SyntaxFactory.IdentifierName(newNameToken)).WithAdditionalAnnotations(Simplifier.Annotation) 215.WithAdditionalAnnotations(Formatter.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceLocal.vb (2)
93SyntaxFactory.EndFunctionStatement()).WithAdditionalAnnotations(Formatter.Annotation) 126declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation, localAnnotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceQueryLocal.vb (1)
30expression)).WithAdditionalAnnotations(Formatter.Annotation)
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (1)
128Return newPropertyDeclaration.WithAdditionalAnnotations(Formatter.Annotation)
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (1)
110Return statement.WithAdditionalAnnotations(Formatter.Annotation)
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.vb (1)
42Return expression.WithAdditionalAnnotations(Simplifier.Annotation)
VisualBasicChangeToYieldCodeFixProvider.vb (1)
42Dim yieldStatement = SyntaxFactory.YieldStatement(returnStatement.Expression).WithAdditionalAnnotations(Formatter.Annotation)
VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
43WithAdditionalAnnotations(Simplifier.Annotation)
VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (2)
100.WithAdditionalAnnotations(Formatter.Annotation) 105.WithAdditionalAnnotations(Formatter.Annotation)
VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
89Dim returnType = knownTypes.TaskOfTType.Construct(methodSymbol.ReturnType).GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
108Dim newCastExpression = Uncast(castExpression).WithAdditionalAnnotations(Formatter.Annotation)
VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52Return statement.ReplaceNode(declarator, declarator.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (12)
Syntax\SerializationTests.vb (6)
72Dim root = tree.GetRoot().WithAdditionalAnnotations(annotation) 98Dim root = tree.GetRoot().WithAdditionalAnnotations(annotation, annotation) 124Dim root = tree.GetRoot().WithAdditionalAnnotations(annotation1) 143Dim doubleAnnoRoot = droot.WithAdditionalAnnotations(annotation1, annotation2) 172Dim root = tree.GetRoot().WithAdditionalAnnotations(annotation1, annotation1) 198Dim root = tree.GetRoot().WithAdditionalAnnotations(annotation)
Syntax\SyntaxAnnotationTests.vb (6)
150Dim annotatedNode = node.WithAdditionalAnnotations(annotation1) 160Dim twiceAnnotatedNode = node2.WithAdditionalAnnotations(annotation2) 270Dim annotatedNode = lastChildOfFirstNode.WithAdditionalAnnotations(annotation1) 539Dim newNode = nodeOrToken.AsNode().WithAdditionalAnnotations(annotation) 677Return MyBase.Visit(node).WithAdditionalAnnotations(_annotation) 718Return MyBase.Visit(node).WithAdditionalAnnotations(annotation)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (60)
CodeGeneration\ExpressionGenerator.StringPiece.vb (1)
73Return result.WithAdditionalAnnotations(Simplifier.Annotation)
CodeGeneration\ExpressionGenerator.vb (4)
144Return DirectCast(expression, MemberAccessExpressionSyntax).WithAdditionalAnnotations(Simplifier.Annotation) 158Return invocation.WithAdditionalAnnotations(Simplifier.Annotation) 391Return expression.WithAdditionalAnnotations(SpecialTypeAnnotation.Create(type)) 404.WithAdditionalAnnotations(Simplifier.Annotation)
CodeGeneration\VisualBasicSyntaxGenerator.vb (3)
148Return SyntaxFactory.DirectCastExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation) 152Return SyntaxFactory.CTypeExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation) 202SyntaxFactory.SeparatedList(typeArguments.Cast(Of TypeSyntax)()))).WithAdditionalAnnotations(Simplifier.Annotation)
CompilationUnitSyntaxExtensions.vb (1)
85[imports].Select(Function(u) u.WithAdditionalAnnotations(annotations)).ToSyntaxList())
ExpressionSyntaxGeneratorVisitor.vb (1)
28expression = expression.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol))
INamespaceOrTypeSymbolExtensions.vb (1)
15Return symbol.Accept(TypeSyntaxGeneratorVisitor.Create(addGlobal)).WithAdditionalAnnotations(Simplifier.Annotation)
ITypeSymbolExtensions.vb (1)
15Return typeSymbol.Accept(New ExpressionSyntaxGeneratorVisitor(addGlobal:=True)).WithAdditionalAnnotations(Simplifier.Annotation)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb\ExpressionSyntaxExtensions.vb (3)
38result.WithAdditionalAnnotations(Simplifier.Annotation), 113.WithAdditionalAnnotations(Simplifier.Annotation) 121.WithAdditionalAnnotations(Simplifier.Annotation)
ParameterSyntaxExtensions.vb (1)
19Dim newParameterSyntax = parameter.WithAsClause(Nothing).WithAdditionalAnnotations(annotation)
Rename\VisualBasicRenameRewriterLanguageService.vb (2)
189newNode = newNode.WithAdditionalAnnotations(annotation) 211expandedNewNode = expandedNewNode.WithAdditionalAnnotations(annotationForSpeculativeNode)
Simplification\Reducers\VisualBasicNameReducer.vb (1)
48node = node.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Formatter.Annotation)
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
45replacementNode = node.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Formatter.Annotation)
Simplification\Simplifiers\ExpressionSimplifier.vb (4)
140replacementNode = replacementNode.WithAdditionalAnnotations( 187replacementNode = memberAccess.Update(memberAccess.Kind, newLeft, memberAccess.OperatorToken, memberAccess.Name).WithAdditionalAnnotations(Simplifier.Annotation) 206replacementNode = qualifiedName.Update(DirectCast(newLeft, NameSyntax), qualifiedName.DotToken, qualifiedName.Right).WithAdditionalAnnotations(Simplifier.Annotation) 260replacementNode = containingType.GenerateTypeSyntax().WithLeadingTrivia(left.GetLeadingTrivia()).WithTrailingTrivia(left.GetTrailingTrivia()).WithAdditionalAnnotations(Simplifier.Annotation)
Simplification\Simplifiers\NameSimplifier.vb (1)
186replacementNode = replacementNode.WithAdditionalAnnotations(New SyntaxAnnotation(codeStyleOptionName))
Simplification\VisualBasicSimplificationService.Expander.vb (21)
117.WithAdditionalAnnotations(Simplifier.Annotation) 120Return SyntaxFactory.Parameter(newNode.AttributeLists, newNode.Modifiers, newNode.Identifier, asClause, newNode.Default).WithAdditionalAnnotations(Simplifier.Annotation) 139.WithAdditionalAnnotations(Simplifier.Annotation) 157.WithAdditionalAnnotations(Simplifier.Annotation) 181.WithAdditionalAnnotations(Simplifier.Annotation) 204.WithAdditionalAnnotations(Simplifier.Annotation) 258newMemberAccess = originalNode.Expression.CopyAnnotationsTo(newMemberAccess).WithAdditionalAnnotations(Simplifier.Annotation) 267.WithAdditionalAnnotations(Simplifier.Annotation) 275Return originalNode.CopyAnnotationsTo(replacementNode).WithAdditionalAnnotations(Simplifier.Annotation) 289.WithAdditionalAnnotations(Simplifier.Annotation) 311WithAdditionalAnnotations(Simplifier.Annotation). 343.WithAdditionalAnnotations(Simplifier.Annotation) 386WithAdditionalAnnotations(Simplifier.Annotation) 433.WithAdditionalAnnotations(Simplifier.Annotation, SimplificationHelpers.SimplifyModuleNameAnnotation), 467.WithAdditionalAnnotations(Simplifier.Annotation, SimplificationHelpers.SimplifyModuleNameAnnotation), 519.WithAdditionalAnnotations(Simplifier.Annotation) 605newNode = DirectCast(newNode, SimpleNameSyntax).WithIdentifier(identifier).WithAdditionalAnnotations(Simplifier.Annotation) 640.WithAdditionalAnnotations(Simplifier.Annotation) 676newNode = newNode.WithAdditionalAnnotations(Simplifier.Annotation) 695.WithAdditionalAnnotations(Simplifier.Annotation) 776result = rewrittenNode.CopyAnnotationsTo(SyntaxFactory.QualifiedName(DirectCast(left, NameSyntax), right.WithAdditionalAnnotations(Simplifier.SpecialTypeAnnotation)))
Simplification\VisualBasicSimplificationService.NodesAndTokensToReduceComputer.vb (2)
51Return node.WithAdditionalAnnotations(SimplificationHelpers.DontSimplifyAnnotation) 156Return node.WithAdditionalAnnotations(SimplificationHelpers.DontSimplifyAnnotation)
SpeculationAnalyzer.vb (1)
88Dim annotatedOriginalExpression = originalExpression.WithAdditionalAnnotations(originalExprAnnotation)
StringExtensions.vb (1)
92Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).WithAdditionalAnnotations(Simplifier.Annotation)
SyntaxNodeExtensions.vb (4)
657SyntaxFactory.EndSubStatement()).WithAdditionalAnnotations(annotations) 728.WithAdditionalAnnotations(annotations) 737.WithAdditionalAnnotations(annotations) 768SyntaxFactory.EndSubStatement()).WithAdditionalAnnotations(annotations)
TypeBlockSyntaxExtensions.vb (3)
94Return SyntaxFactory.EndClassStatement().WithAdditionalAnnotations(Formatter.Annotation) 96Return SyntaxFactory.EndInterfaceStatement().WithAdditionalAnnotations(Formatter.Annotation) 98Return SyntaxFactory.EndStructureStatement().WithAdditionalAnnotations(Formatter.Annotation)
TypeSyntaxGeneratorVisitor.vb (1)
33type = type.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol))
VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
43Return node.WithAdditionalAnnotations(_annotation)
VisualBasicRemoveUnnecessaryImportsService.vb (1)
47newRoot = newRoot.WithAdditionalAnnotations(Formatter.Annotation)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (5)
CodeGeneration\AddImportsTests.vb (1)
56Return c.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol), Simplifier.Annotation)
Formatting\FormattingTests.vb (4)
3777root = root.ReplaceNode(implementsStatement, implementsStatement.NormalizeWhitespace(elasticTrivia:=True).WithAdditionalAnnotations(goo)) 3780root = root.ReplaceNode(field, field.NormalizeWhitespace(elasticTrivia:=True).WithAdditionalAnnotations(goo)) 3782root = root.ReplaceNode(prop, prop.NormalizeWhitespace(elasticTrivia:=True).WithAdditionalAnnotations(goo)) 3785root = root.ReplaceNode(method, method.NormalizeWhitespace(elasticTrivia:=True).WithAdditionalAnnotations(goo))
Microsoft.CodeAnalysis.Workspaces (36)
AbstractCodeGenerationService.cs (1)
73? node.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
AbstractMoveDeclarationNearReferenceService.cs (6)
127: explicitDeclarationStatement.WithAdditionalAnnotations(warningAnnotation); 128declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); 142newNextStatement.WithAdditionalAnnotations(Formatter.Annotation).WithLeadingTrivia( 152(current, generator) => current.WithAdditionalAnnotations(Formatter.Annotation).WithPrependedLeadingTrivia( 164: declarationStatement.WithAdditionalAnnotations(warningAnnotation); 172declarationStatement.WithAdditionalAnnotations(Formatter.Annotation));
AbstractSpeculationAnalyzer.cs (1)
186var 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)
1899name = QualifiedName(name, IdentifierName(part)).WithAdditionalAnnotations(Simplifier.Annotation); 1934: expression.WithAdditionalAnnotations(DoNotAddImportsAnnotation.Annotation); 2159.WithAdditionalAnnotations(Simplifier.Annotation);
Shared\Extensions\SyntaxGeneratorExtensions.cs (6)
63s => s.WithAdditionalAnnotations(Simplifier.Annotation)); 182factory.IdentifierName(parameter.Name))).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation); 248.WithAdditionalAnnotations(Simplifier.Annotation); 613through.WithAdditionalAnnotations(Simplifier.Annotation)); 632through = through.WithAdditionalAnnotations(Simplifier.Annotation); 636return through.WithAdditionalAnnotations(Simplifier.Annotation);
Shared\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (3)
36statements = statements.SelectAsArray(s => s.WithAdditionalAnnotations(statementAnnotation)); 67statements = statements.SelectAsArray(s => s.WithAdditionalAnnotations(statementAnnotation)); 224.WithAdditionalAnnotations(Simplification.Simplifier.Annotation);
Simplification\AbstractSimplificationService.cs (2)
243var newRoot = root.ReplaceNode(nodeOrToken.AsNode()!, currentNode.WithAdditionalAnnotations(marker)); 300return root.ReplaceNodes(importsToSimplify, (o, r) => r.WithAdditionalAnnotations(removeIfUnusedAnnotation));
SimplificationHelpers.cs (1)
35to = to.WithAdditionalAnnotations(DontSimplifyAnnotation);
SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
226factory.IdentifierName(member.Name)).WithAdditionalAnnotations(Simplification.Simplifier.Annotation);
SyntaxGeneratorExtensions_Negate.cs (2)
500.WithAdditionalAnnotations(Simplifier.Annotation); 544.WithAdditionalAnnotations(Simplifier.Annotation);
SyntaxNodeExtensions.cs (1)
310return root.ReplaceNodes(tokenMap.Keys, (o, n) => o.WithAdditionalAnnotations(tokenMap[o]));
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
CodeCleanup\CodeCleanupTests.cs (2)
138document = document.WithSyntaxRoot((await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(annotation)); 151document = document.WithSyntaxRoot((await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(annotation));
SerializationTests.cs (1)
73var rootWithAnnotation = root.WithAdditionalAnnotations(annotation);
SolutionTests\SolutionTests.cs (4)
2543var annotatedRoot = root.WithAdditionalAnnotations(annotation); 2795tree = tree.WithAdditionalAnnotations(new SyntaxAnnotation("test")); 3055var newRoot = doc.GetSyntaxRootAsync().Result.WithAdditionalAnnotations(SyntaxAnnotation.ElasticAnnotation); 4308var newRoot = root.WithAdditionalAnnotations(new SyntaxAnnotation());
WorkspaceTests\AdhocWorkspaceTests.cs (1)
369var newRoot = root.WithAdditionalAnnotations(new SyntaxAnnotation());
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\SnippetExpansionClient.cs (1)
169newUsings.Add(candidateUsing.WithAdditionalAnnotations(Formatter.Annotation).WithAppendedTrailingTrivia(SyntaxFactory.CarriageReturnLineFeed));
Microsoft.VisualStudio.LanguageServices.Implementation (3)
CodeModel\AbstractCodeModelService.cs (3)
1073node = node.WithAdditionalAnnotations(annotation); 1078node = node.WithAdditionalAnnotations(Simplifier.Annotation); 1126var annotatedNode = newNode.WithAdditionalAnnotations(annotation, Simplifier.Annotation);
Microsoft.VisualStudio.LanguageServices.VisualBasic (6)
CodeModel\VisualBasicCodeModelService.vb (5)
1331Dim newDeclarator = declarator.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1344Dim newDeclaration = declaration.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1372Dim newArgumentList = argumentList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1379Dim newParameterList = parameterList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 3939.WithAdditionalAnnotations(Formatter.Annotation)
Snippets\SnippetExpansionClient.vb (1)
204importsToAdd.Add(filteredImportsStatement.WithAdditionalAnnotations(Formatter.Annotation) _