85 references to WithAdditionalAnnotations
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (1)
79=> token.WithAdditionalAnnotations(this.GetOrCreateRealAnnotations(annotations).ToArray());
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
131nameToken = nameToken.WithAdditionalAnnotations(annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
48var newToken = token.WithAdditionalAnnotations(annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (1)
58to = to.WithAdditionalAnnotations(DoNotSimplifyAnnotation);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\StringExtensions.cs (1)
51token = token.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
104return SyntaxFactory.Token(leadingTrivia, kind, trailingTrivia).WithAdditionalAnnotations(Formatter.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (2)
54.WithAdditionalAnnotations(Simplifier.Annotation); 85tokenWithLeadingWhitespace = token.WithLeadingTrivia(SyntaxFactory.ElasticMarker).WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.Features (5)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
476var newIdentifier = identifier.WithAdditionalAnnotations(annotation);
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (3)
129nameToken = nameToken.WithAdditionalAnnotations(WarningAnnotation.Create(warning)); 325editor.ReplaceNode(nameNode, newName.WithIdentifier(newName.Identifier.WithAdditionalAnnotations(annotation))); 384editor.ReplaceNode(nameNode, newName.WithIdentifier(newName.Identifier.WithAdditionalAnnotations(annotation)));
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
196.WithAdditionalAnnotations(RenameAnnotation.Create());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (7)
IncrementalParsing\IncrementalParsingTests.cs (1)
3056var oldRoot = tempRoot.ReplaceToken(tempToken, tempToken.WithAdditionalAnnotations(new SyntaxAnnotation()));
Syntax\SyntaxAnnotationTests.cs (6)
35var newToken = oldToken.WithAdditionalAnnotations(annotation); 196var annotatedToken = token.WithAdditionalAnnotations(annotation1); 206var twiceAnnotatedToken = token2.WithAdditionalAnnotations(annotation2); 589var newToken = nodeOrToken.AsToken().WithAdditionalAnnotations(annotation); 739return base.VisitToken(token).WithAdditionalAnnotations(_annotation); 789return base.VisitToken(token).WithAdditionalAnnotations(annotation);
Microsoft.CodeAnalysis.CSharp.Workspaces (13)
Rename\CSharpRenameRewriterLanguageService.cs (1)
629newToken = newToken.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\CSharpSimplificationService.cs (2)
135.WithAdditionalAnnotations(Simplifier.Annotation); 166tokenWithLeadingWhitespace = token.WithLeadingTrivia(SyntaxFactory.ElasticMarker).WithAdditionalAnnotations(Formatter.Annotation);
Simplification\CSharpSimplificationService.Expander.cs (3)
539newIdentifier = newIdentifier.WithAdditionalAnnotations(_annotationForReplacedAliasIdentifier); 543return newIdentifier.WithAdditionalAnnotations(aliasAnnotationInfo); 599identifier = identifier.WithAdditionalAnnotations(SimplificationHelpers.DoNotSimplifyAnnotation);
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (1)
95return token.WithAdditionalAnnotations(SimplificationHelpers.DoNotSimplifyAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\StringExtensions.cs (1)
51token = token.WithAdditionalAnnotations(Simplifier.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\CSharpSyntaxFactsService.cs (2)
99.WithAdditionalAnnotations(Formatter.Annotation); 109braces.closeBrace.WithAdditionalAnnotations(Formatter.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (2)
54.WithAdditionalAnnotations(Simplifier.Annotation); 85tokenWithLeadingWhitespace = token.WithLeadingTrivia(SyntaxFactory.ElasticMarker).WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Formatting\FormattingTriviaTests.cs (1)
1789.WithAdditionalAnnotations(SyntaxAnnotation.ElasticAnnotation));
Microsoft.CodeAnalysis.Features (20)
AddImport\References\Reference.cs (1)
94root = root.ReplaceToken(identifier, newIdentifier.WithAdditionalAnnotations(annotation));
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (1)
44newEndToken = root.ReplaceToken(startToken, newStartToken.WithAdditionalAnnotations(annotation)).GetAnnotatedTokens(annotation).Single();
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (1)
138invocationNameToken.Value.WithAdditionalAnnotations(RenameAnnotation.Create()));
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
82var annotatedRoot = tree.GetRoot(cancellationToken).ReplaceToken(token, token.WithAdditionalAnnotations(_otherAnnotation));
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
229? g.Identifier(className).WithAdditionalAnnotations(RenameAnnotation.Create())
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
116var collectionVariableToken = generator.Identifier(collectionVariable.ToString()).WithAdditionalAnnotations(RenameAnnotation.Create());
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (3)
359foreachIdentifier = foreachIdentifier.WithAdditionalAnnotations(RenameAnnotation.Create()); 483replacementToken = replacementToken.WithAdditionalAnnotations( 489replacementToken = replacementToken.WithAdditionalAnnotations(
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
410structNameToken = structNameToken.WithAdditionalAnnotations(RenameAnnotation.Create());
ExtractMethod\AbstractSyntaxTriviaService.cs (4)
79map[tokens[TriviaLocation.BeforeBeginningOfSpan]] = token.WithTrailingTrivia(emptyList).WithAdditionalAnnotations(annotations[TriviaLocation.BeforeBeginningOfSpan]); 82map[tokens[TriviaLocation.AfterBeginningOfSpan]] = token.WithLeadingTrivia(emptyList).WithAdditionalAnnotations(annotations[TriviaLocation.AfterBeginningOfSpan]); 85map[tokens[TriviaLocation.BeforeEndOfSpan]] = token.WithTrailingTrivia(emptyList).WithAdditionalAnnotations(annotations[TriviaLocation.BeforeEndOfSpan]); 88map[tokens[TriviaLocation.AfterEndOfSpan]] = token.WithLeadingTrivia(emptyList).WithAdditionalAnnotations(annotations[TriviaLocation.AfterEndOfSpan]);
ExtractMethod\MethodExtractor.cs (1)
169root = root.ReplaceToken(invocationNameToken.Value, invocationNameToken.Value.WithAdditionalAnnotations(annotation));
ExtractMethod\SelectionResult.cs (1)
218return root.ReplaceTokens(tokenMap.Keys, (o, n) => o.WithAdditionalAnnotations(tokenMap[o]));
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
656.WithAdditionalAnnotations(RenameAnnotation.Create()));
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
121nameToken.WithAdditionalAnnotations(RenameAnnotation.Create()),
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
440token = token.WithAdditionalAnnotations(ConflictAnnotation.Create(conflictMessage));
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
132(oldToken, _) => oldToken.WithAdditionalAnnotations(SyntaxAnnotation.ElasticAnnotation)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (4)
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\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (1)
78token = token.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\VisualBasicSimplificationHelpers.vb (1)
30.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Features (8)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.ReferenceRewriter.vb (1)
52Return node.Update(node.Identifier.WithAdditionalAnnotations(
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (2)
325.WithAdditionalAnnotations(Formatter.Annotation) 401Return explicitInitializer.WithAdditionalAnnotations(s_expressionToInlineAnnotation)
ConvertForEachToFor\VisualBasicConvertForEachToForCodeRefactoringProvider.vb (1)
95DirectCast(generator.IdentifierName(indexVariable.WithAdditionalAnnotations(RenameAnnotation.Create())), VisualBasicSyntaxNode),
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (1)
211SyntaxFactory.SingletonSeparatedList(SyntaxFactory.ModifiedIdentifier(newNameToken.WithAdditionalAnnotations(RenameAnnotation.Create()))),
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (1)
185editor.ReplaceNode(nameNode, Function(n, g) newName.WithIdentifier(newName.Identifier.WithAdditionalAnnotations(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)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (6)
Syntax\SyntaxAnnotationTests.vb (6)
32Dim newToken = oldToken.WithAdditionalAnnotations(annotation) 181Dim annotatedToken = token.WithAdditionalAnnotations(annotation1) 191Dim twiceAnnotatedToken = token2.WithAdditionalAnnotations(annotation2) 536Dim newToken = nodeOrToken.AsToken().WithAdditionalAnnotations(annotation) 685Return MyBase.VisitToken(token).WithAdditionalAnnotations(_annotation) 727Return MyBase.VisitToken(token).WithAdditionalAnnotations(annotation)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (7)
Rename\VisualBasicRenameRewriterLanguageService.vb (1)
581newToken = newToken.WithAdditionalAnnotations(Simplifier.Annotation)
Simplification\VisualBasicSimplificationService.Expander.vb (4)
527newIdentifier = newIdentifier.WithAdditionalAnnotations(Me._annotationForReplacedAliasIdentifier) 531newIdentifier = newIdentifier.WithAdditionalAnnotations(aliasAnnotationInfo) 548newIdentifier = newIdentifier.WithAdditionalAnnotations(Me._annotationForReplacedAliasIdentifier) 552newIdentifier = newIdentifier.WithAdditionalAnnotations(aliasAnnotationInfo)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (1)
78token = token.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\VisualBasicSimplificationHelpers.vb (1)
30.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.Workspaces (5)
CodeCleanup\AbstractCodeCleanerService.cs (1)
596return node.ReplaceTokens(tokenMap.Keys, (o, n) => o.WithAdditionalAnnotations([.. tokenMap[o]]));
Rename\RenameUtilities.cs (1)
38token = token.WithAdditionalAnnotations(replacementAliasAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (1)
79=> token.WithAdditionalAnnotations(this.GetOrCreateRealAnnotations(annotations).ToArray());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
48var newToken = token.WithAdditionalAnnotations(annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (1)
58to = to.WithAdditionalAnnotations(DoNotSimplifyAnnotation);
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
190newMethod = newMethod.ReplaceToken(newMethod.Identifier, SyntaxFactory.Identifier(methodName).WithAdditionalAnnotations(RenameAnnotation.Create()));