386 references to Simplifier
ILLink.CodeFixProvider (4)
BaseAttributeCodeFixProvider.cs (2)
76 .WithAdditionalAnnotations (Simplifier.Annotation, Simplifier.AddImportsAnnotation);
DynamicallyAccessedMembersCodeFixProvider.cs (2)
138 .WithAdditionalAnnotations (Simplifier.Annotation, Simplifier.AddImportsAnnotation);
Microsoft.AspNetCore.App.CodeFixes (1)
Http\HeaderDictionaryAddFixer.cs (1)
75root.ReplaceNode(diagnosticTarget, invocation.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation, annotation))));
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Helpers\CodeFixVerifier.Helper.cs (2)
80var simplifiedDoc = Simplifier.ReduceAsync(document, Simplifier.Annotation).Result;
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Helpers\CodeFixVerifier.Helper.cs (2)
80var simplifiedDoc = Simplifier.ReduceAsync(document, Simplifier.Annotation).Result;
Microsoft.AspNetCore.Mvc.Api.Analyzers (5)
AddResponseTypeAttributeCodeFixAction.cs (5)
208.WithAdditionalAnnotations(Simplifier.Annotation), 220.WithAdditionalAnnotations(Simplifier.Annotation)); 224.WithAdditionalAnnotations(Simplifier.Annotation), 238.WithAdditionalAnnotations(Simplifier.Annotation), 250.WithAdditionalAnnotations(Simplifier.Annotation));
Microsoft.CodeAnalysis.CodeStyle.Fixes (28)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
131return (currentTarget.Parent, currentTarget.Parent.ReplaceNode(currentTarget, currentReplacement).WithAdditionalAnnotations(Simplifier.Annotation));
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (2)
80Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(enumerableType));
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
418.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 433.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 689.WithAdditionalAnnotations(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (1)
112conditionalExpression = conditionalExpression.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
73? node.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
56/// True if the code generation service should add <see cref="Simplifier.AddImportsAnnotation"/>,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
102.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 153(o, r) => r.WithAdditionalAnnotations(Simplifier.Annotation, annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (5)
158through.WithAdditionalAnnotations(Simplifier.Annotation)); 173through = through.WithAdditionalAnnotations(Simplifier.Annotation); 177return through.WithAdditionalAnnotations(Simplifier.Annotation); 379.WithAdditionalAnnotations(Simplifier.Annotation); 452factory.IdentifierName(parameter.Name))).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
233.WithAdditionalAnnotations(Simplification.Simplifier.Annotation); 478s => s.WithAdditionalAnnotations(Simplifier.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
226factory.IdentifierName(member.Name)).WithAdditionalAnnotations(Simplification.Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
528.WithAdditionalAnnotations(Simplifier.Annotation); 572.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
122var explicitDeclarationStatement = await Simplifier.ExpandAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (1)
149.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
36protected static readonly Func<SyntaxNodeOrToken, bool> s_hasSimplifierAnnotation = n => n.HasAnnotation(Simplifier.Annotation); 282importDeclarations.Where(n => !isNodeOrTokenOutsideSimplifySpan(n) && n.HasAnnotation(Simplifier.Annotation)),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
29var dontSimplifyResult = !to.HasAnnotation(Simplifier.Annotation); 52var dontSimplifyResult = !to.HasAnnotation(Simplifier.Annotation);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (27)
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
153SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), newNameNode).WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
122fixedDeclaration = fixedDeclaration.WithAdditionalAnnotations(Simplifier.Annotation).WithTriviaFrom(declarationTypeToFix);
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (2)
155return newReturnType.WithTriviaFrom(returnTypeSyntax).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation); 163return result.WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (3)
161return await Simplifier.ReduceAsync(newDocument, Simplifier.Annotation, optionSet: null, cancellationToken).ConfigureAwait(false); 187var newType = await Simplifier.ExpandAsync(usingDirective.NamespaceOrType, document, cancellationToken: cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (2)
67.WithAdditionalAnnotations(Simplifier.Annotation); 79.WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
42statement.Declaration.Type.WithAdditionalAnnotations(Simplifier.Annotation)));
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
129return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
100.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
292return result.WithAdditionalAnnotations(Simplifier.Annotation); 315result = result.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CastExpressionSyntaxExtensions.cs (1)
31.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
51? result.WithAdditionalAnnotations(Simplifier.Annotation) 82? result.WithAdditionalAnnotations(Simplifier.Annotation) 94return castExpression.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (4)
28=> typeSymbol.Accept(ExpressionSyntaxGeneratorVisitor.Create(nameSyntax))!.WithAdditionalAnnotations(Simplifier.Annotation); 52.WithAdditionalAnnotations(Simplifier.Annotation); 79.WithAdditionalAnnotations(Simplifier.Annotation); 89.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\StringExtensions.cs (1)
51token = token.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (3)
246=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 249=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 339=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (1)
54.WithAdditionalAnnotations(Simplifier.Annotation);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (3)
212var simplifiedDocument = await Simplifier.ReduceAsync( 213documentWithNameAndAnnotationsAdded.WithSyntaxRoot(updatedRoot), Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false); 279.WithRight(eventHookupExpression.Right.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.CSharp.Features (37)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (1)
113.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
183currentNode = currentNode.WithAdditionalAnnotations(Simplifier.Annotation); 241newNode = newNode.WithAdditionalAnnotations(Simplifier.Annotation);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
137expressionToInline = expressionToInline.WithoutTrivia().Parenthesize().WithAdditionalAnnotations(Simplifier.Annotation, ExpressionAnnotation);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
209return rewrittenPattern.ConvertToSingleLine().WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation);
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (11)
119return Block(IfStatement(((WhereClauseSyntax)node).Condition.WithAdditionalAnnotations(Simplifier.Annotation).WithoutTrivia(), statement)); 207statement)))).WithAdditionalAnnotations(Simplifier.Annotation); 356methodSymbol.GenerateReturnTypeSyntax().WithAdditionalAnnotations(Simplifier.Annotation), 440nodesBeforeLocal = [parentStatement.ReplaceNode(invocationExpression, initializer.WithAdditionalAnnotations(Simplifier.Annotation))]; 453nodesAfterLocal = [parentStatement.ReplaceNode(invocationExpression, variableLocal.WithAdditionalAnnotations(Simplifier.Annotation))]; 502nodesAfter = new[] { ReturnStatement(variable).WithAdditionalAnnotations(Simplifier.Annotation) }; 529EqualsValueClause(expression))])).WithAdditionalAnnotations(Simplifier.Annotation); 583returnType: returnedType.GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.Annotation), 597var localFunctionInvocation = InvocationExpression(IdentifierName(localFunctionToken)).WithAdditionalAnnotations(Simplifier.Annotation); 598var newParentExpressionStatement = parentStatement.ReplaceNode(_source.WalkUpParentheses(), localFunctionInvocation.WithAdditionalAnnotations(Simplifier.Annotation)); 828statements.Add(statement.WithAdditionalAnnotations(Simplifier.Annotation));
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
462.WithAdditionalAnnotations(Simplifier.Annotation);
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (1)
90method = method.WithReturnType(method.ReturnType.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation));
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
825var methodName = CreateMethodNameForInvocation().WithAdditionalAnnotations(Simplifier.Annotation);
IntroduceVariable\CSharpIntroduceVariableService.Rewriter.cs (3)
52return newNode.WithNameEquals(NameEquals(IdentifierName(inferredName))).WithAdditionalAnnotations(Simplifier.Annotation); 70return newNode.WithNameColon(NameColon(IdentifierName(inferredName))).WithAdditionalAnnotations(Simplifier.Annotation); 86return newNode.WithAdditionalAnnotations(Simplifier.Annotation);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
43newQualifiedName = newQualifiedName.WithAdditionalAnnotations(Simplifier.Annotation);
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.cs (2)
55Simplifier.Annotation, Formatter.Annotation, DoNotAllowVarAnnotation.Annotation); 60annotatedexpressionSyntax = annotatedexpressionSyntax.ReplaceNode(right, right.WithAdditionalAnnotations(Simplifier.Annotation));
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
153SyntaxKind.SimpleMemberAccessExpression, ThisExpression(), newNameNode).WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
122fixedDeclaration = fixedDeclaration.WithAdditionalAnnotations(Simplifier.Annotation).WithTriviaFrom(declarationTypeToFix);
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (2)
155return newReturnType.WithTriviaFrom(returnTypeSyntax).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation); 163return result.WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (3)
164return await Simplifier.ReduceAsync(newDocument, Simplifier.Annotation, simplifierOptions, cancellationToken).ConfigureAwait(false); 187var newType = await Simplifier.ExpandAsync(usingDirective.NamespaceOrType, document, cancellationToken: cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (2)
67.WithAdditionalAnnotations(Simplifier.Annotation); 79.WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
42statement.Declaration.Type.WithAdditionalAnnotations(Simplifier.Annotation)));
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
129return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation);
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
100.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
Microsoft.CodeAnalysis.CSharp.Workspaces (60)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
3118return addSimplifierAnnotation ? block.WithAdditionalAnnotations(Simplifier.Annotation) : block; 3322=> SyntaxFactory.QualifiedName((NameSyntax)left, (SimpleNameSyntax)right).WithAdditionalAnnotations(Simplifier.Annotation);
Rename\CSharpRenameRewriterLanguageService.cs (1)
624newToken = newToken.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\CSharpSimplificationService.cs (2)
86var rewrittenToken = TryEscapeIdentifierToken(rewriter.VisitToken(token), token.Parent).WithAdditionalAnnotations(Simplifier.Annotation); 135.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\CSharpSimplificationService.Expander.cs (15)
188var newParameter = parameters[i].WithType(typeSyntax).WithAdditionalAnnotations(Simplifier.Annotation); 235simpleLambda.Body).WithAdditionalAnnotations(Simplifier.Annotation); 266.WithAdditionalAnnotations(Simplifier.Annotation) 337.WithAdditionalAnnotations(Simplifier.Annotation); 401.WithAdditionalAnnotations(Simplifier.Annotation), 406.WithAdditionalAnnotations(Simplifier.Annotation); 413.WithAdditionalAnnotations(Simplifier.Annotation); 488.WithAdditionalAnnotations(Simplifier.Annotation); 609identifier = TryEscapeIdentifierToken(identifier, originalSimpleName).WithAdditionalAnnotations(Simplifier.Annotation); 659.WithAdditionalAnnotations(Simplifier.Annotation); 713var result = newNode.WithAdditionalAnnotations(Simplifier.Annotation); 756.WithAdditionalAnnotations(Simplifier.Annotation); 979result = rewrittenNode.CopyAnnotationsTo(QualifiedName((NameSyntax)left, right.WithAdditionalAnnotations(Simplifier.SpecialTypeAnnotation))); 1112newMemberAccess = originalNode.Expression.CopyAnnotationsTo(newMemberAccess).WithAdditionalAnnotations(Simplifier.Annotation); 1126.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (2)
66_simplifyAllDescendants = _simplifyAllDescendants || node.HasAnnotation(Simplifier.Annotation); 104_simplifyAllDescendants = _simplifyAllDescendants || token.HasAnnotation(Simplifier.Annotation);
Simplification\Reducers\AbstractCSharpReducer.AbstractReductionRewriter.cs (2)
134if (!this.alwaysSimplify && !node.HasAnnotation(Simplifier.Annotation)) 165return token.HasAnnotation(Simplifier.Annotation)
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (1)
65.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\Reducers\CSharpMiscellaneousReducer.cs (2)
76newParameterSyntax = SimplificationHelpers.CopyAnnotations(node, newParameterSyntax).WithoutAnnotations(Simplifier.Annotation); 104return SimplificationHelpers.CopyAnnotations(parenthesizedLambda, newSimpleLambda).WithoutAnnotations(Simplifier.Annotation);
Simplification\Reducers\CSharpNameReducer.cs (1)
62return node.WithoutAnnotations(Simplifier.Annotation);
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 (1)
28if (!alwaysSimplify && !typeSyntax.HasAnnotation(Simplifier.Annotation))
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
149if (!qualifiedName.Right.HasAnnotation(Simplifier.SpecialTypeAnnotation)) 163if (!aliasQualifiedNameSyntax.Name.HasAnnotation(Simplifier.SpecialTypeAnnotation))
Simplification\Simplifiers\ExpressionSimplifier.cs (2)
293.WithAdditionalAnnotations(Simplifier.Annotation); 304.WithAdditionalAnnotations(Simplifier.Annotation);
Simplification\Simplifiers\NameSimplifier.cs (2)
216if (!qualifiedName2.Right.HasAnnotation(Simplifier.SpecialTypeAnnotation)) 226!aliasQualifiedName.Name.HasAnnotation(Simplifier.SpecialTypeAnnotation))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
292return result.WithAdditionalAnnotations(Simplifier.Annotation); 315result = result.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CastExpressionSyntaxExtensions.cs (1)
31.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
51? result.WithAdditionalAnnotations(Simplifier.Annotation) 82? result.WithAdditionalAnnotations(Simplifier.Annotation) 94return castExpression.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (4)
28=> typeSymbol.Accept(ExpressionSyntaxGeneratorVisitor.Create(nameSyntax))!.WithAdditionalAnnotations(Simplifier.Annotation); 52.WithAdditionalAnnotations(Simplifier.Annotation); 79.WithAdditionalAnnotations(Simplifier.Annotation); 89.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\StringExtensions.cs (1)
51token = token.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (3)
246=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 249=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 339=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (1)
54.WithAdditionalAnnotations(Simplifier.Annotation);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
CodeGeneration\AddImportsTests.cs (2)
52? c.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol), Simplifier.Annotation) 102var reduced = await Simplifier.ReduceAsync(imported, simplifierOptions, CancellationToken.None);
CodeGeneration\SymbolEditorTests.cs (1)
56document = await Simplifier.ReduceAsync(document, CSharpSimplifierOptions.Default, CancellationToken.None);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeGeneration\AbstractCodeGenerationTests.cs (2)
40root.WithAdditionalAnnotations(Simplifier.Annotation)); 43var simplifiedDocument = Simplifier.ReduceAsync(annotatedDocument, options, CancellationToken.None).Result;
CodeGeneration\CodeGenerationTests.cs (2)
959var simplified = Simplifier.ReduceAsync(this.Document, Simplifier.Annotation, simplifierOptions, CancellationToken.None).Result;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (15)
Expansion\AbstractExpansionTest.vb (4)
37root = root.ReplaceNode(node, Await Simplifier.ExpandAsync(node, document, expandInsideNode:=Nothing, expandParameter:=expandParameter)) 42root = root.ReplaceNode(node, Await Simplifier.ExpandAsync(node, document, expandInsideNode:=Nothing, expandParameter:=expandParameter)) 44document = Await Simplifier.ReduceAsync(document, Simplifier.Annotation, cleanupOptions.SimplifierOptions, CancellationToken.None)
Simplification\AbstractSimplificationTests.vb (8)
82root = root.ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation)) 88root = root.ReplaceToken(token, token.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)) 119simplifiedDocument = Await Simplifier.ReduceAsync(document, explicitSpansToSimplifyWithin, optionSet) 121simplifiedDocument = Await Simplifier.ReduceAsync(document, Simplifier.Annotation, optionSet)
Simplification\ParameterSimplificationTests.vb (2)
27(Await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(Simplifier.Annotation)) 29Dim simplifiedDocument = Await Simplifier.ReduceAsync(annotatedDocument, CSharpSimplifierOptions.Default, CancellationToken.None)
Simplification\TypeNameSimplifierTest.vb (1)
4260Dim result = Await Simplifier.ExpandAsync(node, document)
Microsoft.CodeAnalysis.Features (46)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (2)
153Simplifier.Annotation, 154Simplifier.AddImportsAnnotation);
ChangeSignature\AbstractChangeSignatureService.cs (2)
427var reducedDoc = await Simplifier.ReduceAsync(docWithImports, Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken: cancellationToken).ConfigureAwait(false);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (4)
634root = root.WithAdditionalAnnotations(Simplifier.Annotation); 636return await Simplifier.ReduceAsync(formattedDocument, documentOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false); 672return await Simplifier.ReduceAsync(formattedDocument, documentOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false); 734editor.ReplaceNode(oldNode, newNode.WithAdditionalAnnotations(Simplifier.Annotation));
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (3)
132document = await Simplifier.ReduceAsync(document, _annotation, memberContainingDocumentCleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false); 221document = await Simplifier.ReduceAsync(document, Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
51.WithAdditionalAnnotations(Simplifier.Annotation);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
215? converted.WithAdditionalAnnotations(Simplifier.Annotation)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
359fullTypeName = fullTypeName.WithAdditionalAnnotations(Simplifier.Annotation)
EncapsulateField\AbstractEncapsulateFieldService.cs (4)
224documentWithProperty = await Simplifier.ReduceAsync(documentWithProperty, simplifierOptions, cancellationToken).ConfigureAwait(false); 358return Simplifier.Annotation.AddAnnotationToSymbol( 387assigned.WithAdditionalAnnotations(Simplifier.Annotation), 405value.WithAdditionalAnnotations(Simplifier.Annotation));
ExtractInterface\AbstractExtractInterfaceService.cs (2)
302var simplifiedDocument = await Simplifier.ReduceAsync( 304Simplifier.Annotation,
ExtractMethod\MethodExtractor.cs (2)
152var simplifiedDocument = await Simplifier.ReduceAsync(annotatedDocument, Simplifier.Annotation, this.Options.CodeCleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false);
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
468return await Simplifier
IntroduceVariable\AbstractIntroduceVariableService.IntroduceVariableCodeAction.cs (1)
56return await Simplifier.ReduceAsync(changedDocument, simplifierOptions, cancellationToken).ConfigureAwait(false);
MetadataAsSource\AbstractMetadataAsSourceService.cs (1)
66return await Simplifier.ReduceAsync(formattedDoc, reducers, cancellationToken).ConfigureAwait(false);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (6)
287var expandedExtensionInvocation = await Simplifier.ExpandAsync( 297.WithAdditionalAnnotations(Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType))); 324.WithAdditionalAnnotations(Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType))); 336.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(newType)),
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
329.WithAdditionalAnnotations(Simplifier.Annotation);
Shared\Utilities\ExtractTypeHelpers.cs (1)
109var simplified = await Simplifier.ReduceAsync(newTypeDocument, newCleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false);
Snippets\SnippetFunctionService.cs (2)
152var updatedRoot = syntaxRoot.ReplaceNode(nodeToReplace, nodeToReplace.WithAdditionalAnnotations(typeAnnotation, Simplifier.Annotation)); 155var simplifiedDocument = await Simplifier.ReduceAsync(documentWithAnnotations, simplifierOptions, cancellationToken).ConfigureAwait(false);
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
83var reformatSnippetNode = snippetExpressionNode.WithAdditionalAnnotations(FindSnippetAnnotation, Simplifier.Annotation, SymbolAnnotation.Create(consoleSymbol!), Formatter.Annotation);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (2)
151document = await Simplifier.ReduceAsync(document, FindSnippetAnnotation, simplifierOptions, cancellationToken: cancellationToken).ConfigureAwait(false); 215var reformatSnippetNode = snippetExpressionNode.WithAdditionalAnnotations(FindSnippetAnnotation, Simplifier.Annotation, Formatter.Annotation);
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
131return (currentTarget.Parent, currentTarget.Parent.ReplaceNode(currentTarget, currentReplacement).WithAdditionalAnnotations(Simplifier.Annotation));
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (2)
80Simplifier.Annotation, Simplifier.AddImportsAnnotation, SymbolAnnotation.Create(enumerableType));
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
181let caseLabel = (TMemberAccessExpression)generator.MemberAccessExpression(generator.TypeExpression(enumType), e.Name).WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
418.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 433.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 689.WithAdditionalAnnotations(s_newLocalDeclarationStatementAnnotation, Simplifier.Annotation);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (1)
112conditionalExpression = conditionalExpression.WithAdditionalAnnotations(Simplifier.Annotation);
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
ExternalAccess\Razor\SimplifyMethodHandler.cs (2)
63var annotatedSyntaxRoot = newTree.GetRoot(cancellationToken).ReplaceNode(node, node.WithAdditionalAnnotations(Simplifier.Annotation)); 70var newDocument = await Simplifier.ReduceAsync(annotatedDocument, options, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (18)
src\Analyzers\VisualBasic\CodeFixes\ConvertTypeOfToNameOf\VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
43WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\MakeMethodAsynchronous\VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
89Dim returnType = knownTypes.TaskOfTType.Construct(methodSymbol.ReturnType).GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
139Dim expandedStatement = Await Simplifier.ExpandAsync(containingStatement, document, cancellationToken:=cancellationToken).ConfigureAwait(False)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52Return statement.ReplaceNode(declarator, declarator.WithAdditionalAnnotations(Simplifier.Annotation))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.StringPiece.vb (1)
73Return result.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (3)
144Return DirectCast(expression, MemberAccessExpressionSyntax).WithAdditionalAnnotations(Simplifier.Annotation) 158Return invocation.WithAdditionalAnnotations(Simplifier.Annotation) 404.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
38result.WithAdditionalAnnotations(Simplifier.Annotation), 113.WithAdditionalAnnotations(Simplifier.Annotation) 121.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\INamespaceOrTypeSymbolExtensions.vb (1)
15Return symbol.Accept(TypeSyntaxGeneratorVisitor.Create(addGlobal)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ITypeSymbolExtensions.vb (1)
15Return typeSymbol.Accept(New ExpressionSyntaxGeneratorVisitor(addGlobal:=True)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (2)
78token = token.WithAdditionalAnnotations(Simplifier.Annotation) 92Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (2)
525Return SyntaxFactory.DirectCastExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation) 567Return SyntaxFactory.CTypeExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\VisualBasicSimplificationHelpers.vb (1)
30.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (4)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (2)
66newDocument = Await Simplifier.ReduceAsync(newDocument, Simplifier.Annotation, simplifierOptions, cancellationToken).ConfigureAwait(False)
Utilities\CommandHandlers\AbstractImplementAbstractClassOrInterfaceCommandHandler.vb (2)
188newDocument = Await Simplifier.ReduceAsync(newDocument, Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(True)
Microsoft.CodeAnalysis.VisualBasic.Features (15)
AddImport\VisualBasicAddImportFeatureService.vb (1)
210nameSyntax = nameSyntax.WithAdditionalAnnotations(Simplifier.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 (3)
185Return Simplifier.Expand(DirectCast(n, StatementSyntax), semanticModel, document.Project.Solution.Services, cancellationToken:=cancellationToken) 360.WithAdditionalAnnotations(Simplifier.Annotation) 382Dim explicitInitializer = Await Simplifier.ExpandAsync(initializer, updatedDocument, cancellationToken:=cancellationToken).ConfigureAwait(False)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (1)
347Dim methodName = CreateMethodNameForInvocation().WithAdditionalAnnotations(Simplifier.Annotation)
GenerateType\VisualBasicGenerateTypeService.vb (1)
664Dim addedCompilationRoot = compilationRoot.AddImportsStatement(newImport, addImportOptions.PlaceSystemNamespaceFirst, Formatter.Annotation, Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService.Rewriter.vb (1)
42Return newNode.WithAdditionalAnnotations(Simplifier.Annotation)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (1)
34name:=SyntaxFactory.IdentifierName(newNameToken)).WithAdditionalAnnotations(Simplifier.Annotation)
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.vb (1)
42Return expression.WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\ConvertTypeOfToNameOf\VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
43WithAdditionalAnnotations(Simplifier.Annotation)
src\Analyzers\VisualBasic\CodeFixes\MakeMethodAsynchronous\VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
89Dim returnType = knownTypes.TaskOfTType.Construct(methodSymbol.ReturnType).GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
139Dim expandedStatement = Await Simplifier.ExpandAsync(containingStatement, document, cancellationToken:=cancellationToken).ConfigureAwait(False)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
52Return statement.ReplaceNode(declarator, declarator.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (55)
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
174SyntaxFactory.SeparatedList(typeArguments.Cast(Of TypeSyntax)()))).WithAdditionalAnnotations(Simplifier.Annotation)
Rename\VisualBasicRenameRewriterLanguageService.vb (1)
580newToken = newToken.WithAdditionalAnnotations(Simplifier.Annotation)
Simplification\Reducers\AbstractVisualBasicReducer.AbstractReductionRewriter.vb (2)
91If Not _alwaysSimplify AndAlso Not node.HasAnnotation(Simplifier.Annotation) Then 134If Not _alwaysSimplify AndAlso Not token.HasAnnotation(Simplifier.Annotation) Then
Simplification\Reducers\VisualBasicMiscellaneousReducer.vb (1)
36newParameter = SimplificationHelpers.CopyAnnotations(parameter, newParameter).WithoutAnnotations(Simplifier.Annotation)
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\Reducers\VisualBasicNameReducer.vb (1)
49Return node.WithoutAnnotations(Simplifier.Annotation)
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
46Return replacementNode.WithoutAnnotations(Simplifier.Annotation)
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (1)
114If Not qualifiedName.Right.HasAnnotation(Simplifier.SpecialTypeAnnotation) Then
Simplification\Simplifiers\ExpressionSimplifier.vb (3)
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\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 (3)
55Me._simplifyAllDescendants = Me._simplifyAllDescendants OrElse node.HasAnnotation(Simplifier.Annotation) 95Me._simplifyAllDescendants = Me._simplifyAllDescendants OrElse token.HasAnnotation(Simplifier.Annotation) 160Me._simplifyAllDescendants = Me._simplifyAllDescendants OrElse node.HasAnnotation(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.StringPiece.vb (1)
73Return result.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (3)
144Return DirectCast(expression, MemberAccessExpressionSyntax).WithAdditionalAnnotations(Simplifier.Annotation) 158Return invocation.WithAdditionalAnnotations(Simplifier.Annotation) 404.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
38result.WithAdditionalAnnotations(Simplifier.Annotation), 113.WithAdditionalAnnotations(Simplifier.Annotation) 121.WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\INamespaceOrTypeSymbolExtensions.vb (1)
15Return symbol.Accept(TypeSyntaxGeneratorVisitor.Create(addGlobal)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ITypeSymbolExtensions.vb (1)
15Return typeSymbol.Accept(New ExpressionSyntaxGeneratorVisitor(addGlobal:=True)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (2)
78token = token.WithAdditionalAnnotations(Simplifier.Annotation) 92Return SyntaxFactory.IdentifierName(text.ToIdentifierToken()).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (2)
525Return SyntaxFactory.DirectCastExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation) 567Return SyntaxFactory.CTypeExpression(DirectCast(expression, ExpressionSyntax), DirectCast(type, TypeSyntax)).WithAdditionalAnnotations(Simplifier.Annotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\VisualBasicSimplificationHelpers.vb (1)
30.WithAdditionalAnnotations(Simplifier.Annotation))
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (2)
CodeGeneration\AddImportsTests.vb (2)
56Return c.WithAdditionalAnnotations(SymbolAnnotation.Create(symbol), Simplifier.Annotation) 107Dim reduced = Await Simplifier.ReduceAsync(imported, simplifierOptions, CancellationToken.None)
Microsoft.CodeAnalysis.Workspaces (29)
CodeActions\CodeAction.cs (1)
471/// Reducing nodes annotated with <see cref="Simplifier.Annotation"/>
CodeActions\CodeAction_Cleanup.cs (3)
36static (document, options, cancellationToken) => ImportAdder.AddImportsFromSymbolAnnotationAsync(document, Simplifier.AddImportsAnnotation, options.AddImportOptions, cancellationToken), 38static (document, options, cancellationToken) => Simplifier.ReduceAsync(document, Simplifier.Annotation, options.SimplifierOptions, cancellationToken),
CodeCleanup\Providers\SimplificationCodeCleanupProvider.cs (1)
20=> Simplifier.ReduceAsync(document, spans, options.SimplifierOptions, cancellationToken);
Editing\SyntaxGenerator.cs (2)
30/// preference if <see cref="Simplifier" /> is used. 1912name = QualifiedName(name, IdentifierName(part)).WithAdditionalAnnotations(Simplifier.Annotation);
Rename\ConflictEngine\RenamedSpansTracker.cs (2)
158document = await Simplifier.ReduceAsync(document, Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
73? node.WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
56/// True if the code generation service should add <see cref="Simplifier.AddImportsAnnotation"/>,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
102.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation); 153(o, r) => r.WithAdditionalAnnotations(Simplifier.Annotation, annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (5)
158through.WithAdditionalAnnotations(Simplifier.Annotation)); 173through = through.WithAdditionalAnnotations(Simplifier.Annotation); 177return through.WithAdditionalAnnotations(Simplifier.Annotation); 379.WithAdditionalAnnotations(Simplifier.Annotation); 452factory.IdentifierName(parameter.Name))).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
233.WithAdditionalAnnotations(Simplification.Simplifier.Annotation); 478s => s.WithAdditionalAnnotations(Simplifier.Annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
226factory.IdentifierName(member.Name)).WithAdditionalAnnotations(Simplification.Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
528.WithAdditionalAnnotations(Simplifier.Annotation); 572.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
122var explicitDeclarationStatement = await Simplifier.ExpandAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (1)
149.WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
36protected static readonly Func<SyntaxNodeOrToken, bool> s_hasSimplifierAnnotation = n => n.HasAnnotation(Simplifier.Annotation); 282importDeclarations.Where(n => !isNodeOrTokenOutsideSimplifySpan(n) && n.HasAnnotation(Simplifier.Annotation)),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
29var dontSimplifyResult = !to.HasAnnotation(Simplifier.Annotation); 52var dontSimplifyResult = !to.HasAnnotation(Simplifier.Annotation);
Microsoft.CodeAnalysis.Workspaces.UnitTests (19)
Simplifier\SimplifierTests.cs (19)
38await Assert.ThrowsAsync<ArgumentNullException>("node", () => Simplifier.ExpandAsync<SyntaxNode>(node: null!, document: null!)); 39await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ExpandAsync(node: node, document: null!)); 40await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ExpandAsync(token: default, document: null!)); 49Assert.Throws<ArgumentNullException>("node", () => Simplifier.Expand<SyntaxNode>(node: null!, semanticModel: null!, services: null!)); 50Assert.Throws<ArgumentNullException>("semanticModel", () => Simplifier.Expand(node, semanticModel: null!, services: null!)); 51Assert.Throws<ArgumentNullException>("services", () => Simplifier.Expand(node, semanticModel, services: null!)); 52Assert.Throws<ArgumentNullException>("workspace", () => Simplifier.Expand(node, semanticModel, workspace: null!)); 53Assert.Throws<ArgumentNullException>("workspace", () => Simplifier.Expand(token: default, semanticModel: null!, workspace: null!)); 54Assert.Throws<ArgumentNullException>("workspace", () => Simplifier.Expand(token: default, semanticModel, workspace: null!)); 63await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ReduceAsync(document: null!)); 64await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ReduceAsync(document: null!, annotation: null!)); 65await Assert.ThrowsAsync<ArgumentNullException>("annotation", () => Simplifier.ReduceAsync(document, annotation: null!)); 66await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ReduceAsync(document: null!, span: default)); 67await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ReduceAsync(document: null!, spans: null!)); 68await Assert.ThrowsAsync<ArgumentNullException>("spans", () => Simplifier.ReduceAsync(document, spans: null!)); 85ValidateCSharpOptions((CSharpSimplifierOptions)await Simplifier.GetOptionsAsync(csDocument, updatedOptions, CancellationToken.None)); 86ValidateVisualBasicOptions((VisualBasicSimplifierOptions)await Simplifier.GetOptionsAsync(vbDocument, updatedOptions, CancellationToken.None)); 94ValidateCSharpOptions((CSharpSimplifierOptions)await Simplifier.GetOptionsAsync(csDocumentWithUpdatedOptions, optionSet: null, CancellationToken.None)); 95ValidateVisualBasicOptions((VisualBasicSimplifierOptions)await Simplifier.GetOptionsAsync(vbDocumentWithUpdatedOptions, optionSet: null, CancellationToken.None));
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\AddGeneratedComClassFixer.cs (1)
28var attribute = gen.Attribute(gen.TypeExpression(editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.GeneratedComClassAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation));
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (1)
78var generatedComInterfaceAttribute = gen.Attribute(gen.TypeExpression(comp.GetTypeByMetadataName(TypeNames.GeneratedComInterfaceAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation));
Microsoft.VisualStudio.LanguageServices (2)
Venus\ContainedLanguageCodeSupport.cs (2)
226newRoot = Simplifier.ReduceAsync( 227targetDocument.WithSyntaxRoot(newRoot), Simplifier.Annotation, options.CleanupOptions.SimplifierOptions, cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetSyntaxRootSynchronously(cancellationToken);
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (1)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (1)
155WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation)