113 references to HasAnnotation
Microsoft.CodeAnalysis (2)
Syntax\SyntaxNodeExtensions_Tracking.cs (1)
53return root.ReplaceNodes(nodes, (n, r) => n.HasAnnotation(GetId(n)!) ? r : r.WithAdditionalAnnotations(GetId(n)!));
Syntax\SyntaxNodeOrToken.cs (1)
571return _nodeOrParent.HasAnnotation(annotation);
Microsoft.CodeAnalysis.CodeStyle (1)
AnnotationTable.cs (1)
165=> node.HasAnnotation(this.GetRealAnnotation(annotation));
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
AbstractRemoveUnusedValuesCodeFixProvider.cs (6)
777foreach (var memberDecl in newRoot.DescendantNodes().Where(n => n.HasAnnotation(s_memberAnnotation))) 822.Where(n => n.HasAnnotation(s_newLocalDeclarationStatementAnnotation) || 823n.HasAnnotation(s_existingLocalDeclarationWithoutInitializerAnnotation)) 860else if (declStatement.HasAnnotation(s_newLocalDeclarationStatementAnnotation)) 887if (newDecl.HasAnnotation(s_unusedLocalDeclarationAnnotation) || 888newDecl.HasAnnotation(s_existingLocalDeclarationWithoutInitializerAnnotation))
SimplificationHelpers.cs (1)
29var dontSimplifyResult = !to.HasAnnotation(Simplifier.Annotation);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
CSharpUseImplicitTypeHelper.cs (1)
38if (typeName.HasAnnotation(DoNotAllowVarAnnotation.Annotation))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
MultiLineConditionalExpressionFormattingRule.cs (2)
39return token.Parent.HasAnnotation(SpecializedFormattingAnnotation); 60if (node.HasAnnotation(SpecializedFormattingAnnotation) &&
Microsoft.CodeAnalysis.CSharp.Features (4)
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
86documentWithImportsAdded, n => n.HasAnnotation(annotation), options.FormattingOptions, cancellationToken).ConfigureAwait(false);
IntroduceVariable\CSharpIntroduceVariableService.Rewriter.cs (1)
49if (innerExpression.HasAnnotation(_replacementAnnotation))
MultiLineConditionalExpressionFormattingRule.cs (2)
39return token.Parent.HasAnnotation(SpecializedFormattingAnnotation); 60if (node.HasAnnotation(SpecializedFormattingAnnotation) &&
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (19)
Syntax\SerializationTests.cs (18)
68Assert.True(root.HasAnnotation(annotation)); 80Assert.True(droot.HasAnnotation(annotation)); 92Assert.True(root.HasAnnotation(annotation)); 104Assert.True(droot.HasAnnotation(annotation)); 116Assert.True(root.HasAnnotation(annotation)); 128Assert.True(droot.HasAnnotation(annotation)); 145Assert.True(root.HasAnnotation(annotation1)); 148Assert.False(removedRoot.HasAnnotation(annotation1)); 158Assert.False(droot.HasAnnotation(annotation1)); 164Assert.True(doubleAnnoRoot.HasAnnotation(annotation1)); 165Assert.True(doubleAnnoRoot.HasAnnotation(annotation2)); 168Assert.False(removedDoubleAnnoRoot.HasAnnotation(annotation1)); 169Assert.False(removedDoubleAnnoRoot.HasAnnotation(annotation2)); 179Assert.False(droot.HasAnnotation(annotation1)); 180Assert.False(droot.HasAnnotation(annotation2)); 191Assert.True(root.HasAnnotation(annotation1)); 194Assert.False(removedRoot.HasAnnotation(annotation1)); 204Assert.False(droot.HasAnnotation(annotation1));
Syntax\SyntaxNodeTests.cs (1)
496var nodesWithMyAnnotations = exprWithAnnotations.DescendantNodesAndSelf(n => n.ContainsAnnotations).Where(n => n.HasAnnotation(myAnnotation)).ToList();
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
CSharpUseImplicitTypeHelper.cs (1)
38if (typeName.HasAnnotation(DoNotAllowVarAnnotation.Annotation))
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (1)
67_simplifyAllDescendants = _simplifyAllDescendants || node.HasAnnotation(Simplifier.Annotation);
Simplification\Reducers\AbstractCSharpReducer.AbstractReductionRewriter.cs (2)
131if (!this.alwaysSimplify && !node.HasAnnotation(Simplifier.Annotation)) 142if (!node.HasAnnotation(SimplificationHelpers.DontSimplifyAnnotation))
Simplification\Reducers\CSharpNameReducer.Rewriter.cs (10)
29this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 47this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 65this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 83this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 101this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 119this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 137this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 155this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 173this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation); 191this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation);
Simplification\Reducers\CSharpVarReducer.Rewriter.cs (2)
28if (!alwaysSimplify && !typeSyntax.HasAnnotation(Simplifier.Annotation)) 34if (typeSyntax.HasAnnotation(SimplificationHelpers.DontSimplifyAnnotation))
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
155if (!qualifiedName.Right.HasAnnotation(Simplifier.SpecialTypeAnnotation)) 169if (!aliasQualifiedNameSyntax.Name.HasAnnotation(Simplifier.SpecialTypeAnnotation))
Simplification\Simplifiers\NameSimplifier.cs (2)
216if (!qualifiedName2.Right.HasAnnotation(Simplifier.SpecialTypeAnnotation)) 226!aliasQualifiedName.Name.HasAnnotation(Simplifier.SpecialTypeAnnotation))
Microsoft.CodeAnalysis.Features (7)
AbstractRemoveUnusedValuesCodeFixProvider.cs (6)
777foreach (var memberDecl in newRoot.DescendantNodes().Where(n => n.HasAnnotation(s_memberAnnotation))) 822.Where(n => n.HasAnnotation(s_newLocalDeclarationStatementAnnotation) || 823n.HasAnnotation(s_existingLocalDeclarationWithoutInitializerAnnotation)) 860else if (declStatement.HasAnnotation(s_newLocalDeclarationStatementAnnotation)) 887if (newDecl.HasAnnotation(s_unusedLocalDeclarationAnnotation) || 888newDecl.HasAnnotation(s_existingLocalDeclarationWithoutInitializerAnnotation))
PullMemberUp\MembersPuller.cs (1)
393node => node.HasAnnotation(s_removableImportAnnotation),
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (2)
VisualBasicRemoveUnnecessaryImportsRewriter.vb (2)
55If oldImport.HasAnnotation(_annotation) Then 141If Not compilationUnit.Imports.Any(Function(i) i.HasAnnotation(_annotation)) Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
MultiLineConditionalExpressionFormattingRule.vb (2)
33Return token.Parent.HasAnnotation( 54If node.HasAnnotation(UseConditionalExpressionCodeFixHelpers.SpecializedFormattingAnnotation) AndAlso
Microsoft.CodeAnalysis.VisualBasic.Features (4)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.CallSiteContainerRewriter.vb (1)
49Dim nodesToRemove = result.DescendantNodes(Function(n) n.ContainsAnnotations).Where(Function(n) n.HasAnnotation(s_removeAnnotation))
IntroduceVariable\VisualBasicIntroduceVariableService.Rewriter.vb (1)
40If innerExpression.HasAnnotation(_replacementAnnotation) AndAlso innerExpression.Equals(parenthesizedExpression.Expression) Then
MultiLineConditionalExpressionFormattingRule.vb (2)
33Return token.Parent.HasAnnotation( 54If node.HasAnnotation(UseConditionalExpressionCodeFixHelpers.SpecializedFormattingAnnotation) AndAlso
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (18)
Syntax\SerializationTests.vb (18)
74Assert.True(root.HasAnnotation(annotation)) 86Assert.True(droot.HasAnnotation(annotation)) 100Assert.True(root.HasAnnotation(annotation)) 112Assert.True(droot.HasAnnotation(annotation)) 126Assert.Equal(True, root.HasAnnotation(annotation1)) 129Assert.Equal(False, removedRoot.HasAnnotation(annotation1)) 139Assert.Equal(False, droot.HasAnnotation(annotation1)) 145Assert.Equal(True, doubleAnnoRoot.HasAnnotation(annotation1)) 146Assert.Equal(True, doubleAnnoRoot.HasAnnotation(annotation2)) 149Assert.Equal(False, removedDoubleAnnoRoot.HasAnnotation(annotation1)) 150Assert.Equal(False, removedDoubleAnnoRoot.HasAnnotation(annotation2)) 160Assert.Equal(False, droot.HasAnnotation(annotation1)) 161Assert.Equal(False, droot.HasAnnotation(annotation2)) 174Assert.Equal(True, root.HasAnnotation(annotation1)) 177Assert.Equal(False, removedRoot.HasAnnotation(annotation1)) 187Assert.Equal(False, droot.HasAnnotation(annotation1)) 200Assert.True(root.HasAnnotation(annotation)) 212Assert.True(droot.HasAnnotation(annotation))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (15)
Simplification\Reducers\AbstractVisualBasicReducer.AbstractReductionRewriter.vb (2)
91If Not _alwaysSimplify AndAlso Not node.HasAnnotation(Simplifier.Annotation) Then 100If Not node.HasAnnotation(SimplificationHelpers.DontSimplifyAnnotation) Then
Simplification\Reducers\VisualBasicNameReducer.Rewriter.vb (6)
21Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation) 37Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation) 53Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation) 69Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation) 85Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation) 101Me._alwaysSimplify = node.HasAnnotation(Simplifier.Annotation)
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (1)
114If Not qualifiedName.Right.HasAnnotation(Simplifier.SpecialTypeAnnotation) Then
Simplification\Simplifiers\ExpressionSimplifier.vb (1)
151If memberAccess.HasAnnotation(SimplificationHelpers.SimplifyModuleNameAnnotation) Then
Simplification\Simplifiers\NameSimplifier.vb (1)
223If qualifiedName.HasAnnotation(SimplificationHelpers.SimplifyModuleNameAnnotation) Then
Simplification\VisualBasicSimplificationService.NodesAndTokensToReduceComputer.vb (2)
58Me._simplifyAllDescendants = Me._simplifyAllDescendants OrElse node.HasAnnotation(Simplifier.Annotation) 163Me._simplifyAllDescendants = Me._simplifyAllDescendants OrElse node.HasAnnotation(Simplifier.Annotation)
VisualBasicRemoveUnnecessaryImportsRewriter.vb (2)
55If oldImport.HasAnnotation(_annotation) Then 141If Not compilationUnit.Imports.Any(Function(i) i.HasAnnotation(_annotation)) Then
Microsoft.CodeAnalysis.Workspaces (6)
AnnotationTable.cs (1)
165=> node.HasAnnotation(this.GetRealAnnotation(annotation));
Editing\ImportAdderService.cs (2)
156var first = root.DescendantNodesAndSelf().First(x => x.HasAnnotation(annotation)); 157var last = root.DescendantNodesAndSelf().Last(x => x.HasAnnotation(annotation));
Simplification\AbstractSimplificationService.cs (2)
247currentNodeOrToken = newRoot.DescendantNodes().Single(c => c.HasAnnotation(marker)); 298&& n.HasAnnotation(Simplifier.Annotation));
SimplificationHelpers.cs (1)
29var dontSimplifyResult = !to.HasAnnotation(Simplifier.Annotation);
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
SerializationTests.cs (2)
75Assert.True(rootWithAnnotation.HasAnnotation(annotation)); 83Assert.True(droot.HasAnnotation(annotation));
SolutionTests\SolutionTests.cs (1)
2560Assert.True(root2.HasAnnotation(annotation));