172 references to WithTriviaFrom
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
520var call = gen.InvocationExpression(memberAccessExpression, argList).WithTriviaFrom(invocationExpression);
Microsoft.CodeAnalysis.CodeStyle.Fixes (15)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
152return (targetNode, this.Cast(castedExpression, conversionType).WithTriviaFrom(targetNode));
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
72generator.WithModifiers(fieldDeclaration.WithoutTrivia(), modifiers).WithTriviaFrom(fieldDeclaration));
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
239return generator.InvocationExpression(taskFromResult, expression.WithoutTrivia()).WithTriviaFrom(expression);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
417.WithTriviaFrom(node) 432.WithTriviaFrom(node)
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (1)
81return generatorInternal.AddParentheses(replacement.WithTriviaFrom(expr));
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
47editor.ReplaceNode(node, editor.Generator.LiteralExpression(newDocCommentId).WithTriviaFrom(node));
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (2)
79return Increment((TExpressionSyntax)leftOfAssign, PreferPostfix(syntaxFacts, currentAssignment)).WithTriviaFrom(currentAssignment); 82return Decrement((TExpressionSyntax)leftOfAssign, PreferPostfix(syntaxFacts, currentAssignment)).WithTriviaFrom(currentAssignment);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
112conditionalExpression)).WithTriviaFrom(ifStatement);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
81returnStatement = returnStatement.WithTriviaFrom(ifStatement);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
124conditionalPart.WithTriviaFrom(conditionalExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (3)
77.WithTriviaFrom(expressionOrPattern); 102.WithTriviaFrom(expressionOrPattern); 492return newLiteralExpression.WithTriviaFrom(expression);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
193SyntaxFactory.IdentifierName("var").WithTriviaFrom(declarationTypeNode).WithAdditionalAnnotations(annotation));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (31)
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
99.WithTriviaFrom(methodDeclaration));
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
141(node, generator) => IdentifierName(parameter.Name.ToIdentifierToken()).WithTriviaFrom(node));
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
155return newReturnType.WithTriviaFrom(returnTypeSyntax).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
src\Analyzers\CSharp\CodeFixes\MakeMethodSynchronous\CSharpMakeMethodSynchronousCodeFixProvider.cs (2)
64newReturnType = SyntaxFactory.PredefinedType(VoidKeyword).WithTriviaFrom(returnTypeSyntax); 69newReturnType = returnType.GetTypeArguments()[0].GenerateTypeSyntax().WithTriviaFrom(returnTypeSyntax);
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (4)
74? DiscardDesignation().WithTriviaFrom(node) 75: SingleVariableDesignation(newName).WithTriviaFrom(node); 83? DiscardPattern().WithTriviaFrom(node) 251return pattern.WithDesignation(discardDesignation.WithTriviaFrom(pattern.Designation));
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
72var newRoot = syntaxRoot.ReplaceNode(defaultLiteral, newExpression.WithTriviaFrom(defaultLiteral));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
192return collectionExpression.WithTriviaFrom(expressionToReplace);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
124.WithTriviaFrom(creationExpression)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
60.WithTriviaFrom(invocationExpression)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
83.WithTriviaFrom(invocationExpression)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
59.WithTriviaFrom(objectCreationExpression)
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
64assignment.Right).WithTriviaFrom(assignment);
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
109return currentMemberAccess.Name.WithTriviaFrom(currentMemberAccess);
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
222.WithTriviaFrom(typeSyntax);
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (1)
51.WithTriviaFrom(type);
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (2)
104castExpr.Expression.WithTriviaFrom(binary.Left), 106ConstantPattern(nullLiteral).WithTriviaFrom(binary.Right));
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
185? invocation.WithExpression(memberAccess.Expression).WithTriviaFrom(invocation) // remove it
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
275return current.WithModifiers(current.Modifiers.Remove(inKeyword)).WithTriviaFrom(current);
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (3)
105lockTypeExpression.WithTriviaFrom(variableDeclaration.Type)); 111lockTypeExpression.WithTriviaFrom(objectCreationExpression.Type)); 158lockTypeExpression.WithTriviaFrom(objectCreation.Type));
src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (1)
66editor.ReplaceNode(localDeclarationStatement, tupleAssignmentStatement.WithTriviaFrom(localDeclarationStatement));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
66return parenthesized.WithTriviaFrom(expression); 80var result = parenthesized.WithTriviaFrom(pattern); 92targetType.GenerateTypeSyntax(), parenthesized.WithoutTrivia()).WithTriviaFrom(parenthesized);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
128IdentifierName(fieldOrProperty.Name.EscapeIdentifier()).WithTriviaFrom(identifierName));
Microsoft.CodeAnalysis.CSharp.Features (48)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.ReferenceRewriter.cs (3)
51? result.WithTriviaFrom(node) 71SyntaxFactory.NameEquals(identifier), UpdateIdentifier(identifier)).WithTriviaFrom(node); 84SyntaxFactory.NameColon(identifier), node.RefKindKeyword, UpdateIdentifier(identifier)).WithTriviaFrom(node);
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (3)
149newNode = newNode.WithTriviaFrom(oldNode); 166newNode = newNode.WithTriviaFrom(oldNode); 258.WithTriviaFrom(namespaceDecl.Name).WithAdditionalAnnotations(WarningAnnotation))
ConvertAnonymousType\CSharpConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
63=> Argument(ConvertName(declarator.NameEquals), refKindKeyword: default, declarator.Expression).WithTriviaFrom(declarator);
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (1)
88var newStringExpression = convert(charService, sb, stringExpression).WithTriviaFrom(stringExpression);
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
253mainDocumentEditor.ReplaceNode(baseType, (current, _) => SimpleBaseType(((PrimaryConstructorBaseTypeSyntax)current).Type).WithTriviaFrom(baseType));
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
173.WithTriviaFrom(fieldDeclaration));
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (2)
254return parsed.WithTriviaFrom(stringExpression); 634return parsed.WithTriviaFrom(stringExpression);
ConvertTupleToStruct\CSharpConvertTupleToStructCodeRefactoringProvider.cs (1)
45var newName = SyntaxFactory.IdentifierName(name).WithTriviaFrom(nameColon.Name);
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
139g.CastExpression(interfaceType, current.WithoutTrivia())).WithTriviaFrom(current));
IntroduceUsingStatement\CSharpIntroduceUsingStatementCodeRefactoringProvider.cs (1)
80.WithSemicolonToken(expressionStatement.SemicolonToken).WithTriviaFrom(expressionStatement);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
243var newRoot = document.Root.ReplaceNode(oldParentingNode, WithBlockBody(oldParentingNode, newBody).WithTriviaFrom(oldParentingNode));
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (2)
299return IdentifierName("value").WithTriviaFrom(node); 377newName = newName.WithTriviaFrom(invocation is null ? nameToken.Parent : invocation);
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
99.WithTriviaFrom(methodDeclaration));
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
141(node, generator) => IdentifierName(parameter.Name.ToIdentifierToken()).WithTriviaFrom(node));
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
155return newReturnType.WithTriviaFrom(returnTypeSyntax).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation);
src\Analyzers\CSharp\CodeFixes\MakeMethodSynchronous\CSharpMakeMethodSynchronousCodeFixProvider.cs (1)
64newReturnType = SyntaxFactory.PredefinedType(VoidKeyword).WithTriviaFrom(returnTypeSyntax);
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (4)
74? DiscardDesignation().WithTriviaFrom(node) 75: SingleVariableDesignation(newName).WithTriviaFrom(node); 83? DiscardPattern().WithTriviaFrom(node) 251return pattern.WithDesignation(discardDesignation.WithTriviaFrom(pattern.Designation));
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
72var newRoot = syntaxRoot.ReplaceNode(defaultLiteral, newExpression.WithTriviaFrom(defaultLiteral));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
192return collectionExpression.WithTriviaFrom(expressionToReplace);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
124.WithTriviaFrom(creationExpression)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
60.WithTriviaFrom(invocationExpression)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
83.WithTriviaFrom(invocationExpression)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
59.WithTriviaFrom(objectCreationExpression)
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
64assignment.Right).WithTriviaFrom(assignment);
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
109return currentMemberAccess.Name.WithTriviaFrom(currentMemberAccess);
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (1)
51.WithTriviaFrom(type);
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (2)
104castExpr.Expression.WithTriviaFrom(binary.Left), 106ConstantPattern(nullLiteral).WithTriviaFrom(binary.Right));
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
185? invocation.WithExpression(memberAccess.Expression).WithTriviaFrom(invocation) // remove it
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
275return current.WithModifiers(current.Modifiers.Remove(inKeyword)).WithTriviaFrom(current);
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (3)
105lockTypeExpression.WithTriviaFrom(variableDeclaration.Type)); 111lockTypeExpression.WithTriviaFrom(objectCreationExpression.Type)); 158lockTypeExpression.WithTriviaFrom(objectCreation.Type));
src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (1)
66editor.ReplaceNode(localDeclarationStatement, tupleAssignmentStatement.WithTriviaFrom(localDeclarationStatement));
UseAutoProperty\UseAutoPropertyRewriter.cs (4)
29return FieldExpression().WithTriviaFrom(node); 34return node.WithName(_propertyIdentifierName.WithTriviaFrom(identifierName)); 51return _propertyIdentifierName.WithTriviaFrom(node); 55return FieldExpression().WithTriviaFrom(node);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
225SyntaxFactory.SingleVariableDesignation(newLocalName))).WithTriviaFrom(isExpression);
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
Simplification\Reducers\CSharpDefaultExpressionReducer.Rewriter.cs (1)
38.WithTriviaFrom(node);
Simplification\Reducers\CSharpInferredMemberNameReducer.Rewriter.cs (2)
33return node.WithNameColon(null).WithTriviaFrom(node); 45return node.WithNameEquals(null).WithTriviaFrom(node);
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
376return node.WithTriviaFrom(nodeToReplace);
Simplification\Simplifiers\ExpressionSimplifier.cs (1)
435replacementNode = containingType.GenerateTypeSyntax().WithTriviaFrom(left);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
193SyntaxFactory.IdentifierName("var").WithTriviaFrom(declarationTypeNode).WithAdditionalAnnotations(annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
66return parenthesized.WithTriviaFrom(expression); 80var result = parenthesized.WithTriviaFrom(pattern); 92targetType.GenerateTypeSyntax(), parenthesized.WithoutTrivia()).WithTriviaFrom(parenthesized);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
128IdentifierName(fieldOrProperty.Name.EscapeIdentifier()).WithTriviaFrom(identifierName));
Microsoft.CodeAnalysis.Features (31)
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (1)
126.WithTriviaFrom(expression);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
172(currentId, g) => g.IdentifierName(newName).WithTriviaFrom(currentId));
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
495generator.IdentifierName(replacementToken).WithTriviaFrom(indexMatch));
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (1)
103generator.CreateInterpolatedStringEndToken()).WithTriviaFrom(literalExpression);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (2)
744return (TArgumentSyntax)generator.Argument(expr).WithTriviaFrom(argument); 794return typeNameNode.WithTriviaFrom(currentNode);
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (6)
437return (statementContainsInvocation, declarationNode.WithTriviaFrom(statementContainsInvocation)); 445return (statementContainsInvocation, throwStatement.WithTriviaFrom(statementContainsInvocation)); 461return (statementContainsInvocation, throwStatement.WithTriviaFrom(statementContainsInvocation)); 500return (statementContainsInvocation, localDeclarationNode.WithTriviaFrom(statementContainsInvocation)); 518.WithTriviaFrom(calleeInvocationNode); 519return (calleeInvocationNode, throwExpression.WithTriviaFrom(calleeInvocationNode));
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
86var newArgument = WithName(argument, elementName).WithTriviaFrom(argument);
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (2)
213cancellationToken).WithTriviaFrom(statement); 300var containerWithConditionalReplaced = container.ReplaceNode(conditionalExpression, TryConvert(expression, conditionalType).WithTriviaFrom(conditionalExpression));
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (2)
345newIdentifierName = newIdentifierName.WithTriviaFrom(_identifierName); 368newIdentifierName = newIdentifierName.WithTriviaFrom(_identifierName);
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
152return (targetNode, this.Cast(castedExpression, conversionType).WithTriviaFrom(targetNode));
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
72generator.WithModifiers(fieldDeclaration.WithoutTrivia(), modifiers).WithTriviaFrom(fieldDeclaration));
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (2)
232.WithTriviaFrom(currentAwaitExpression)); 254return currentInvocationExpression.WithTriviaFrom(currentAwaitExpression);
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
239return generator.InvocationExpression(taskFromResult, expression.WithoutTrivia()).WithTriviaFrom(expression);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
417.WithTriviaFrom(node) 432.WithTriviaFrom(node)
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (1)
81return generatorInternal.AddParentheses(replacement.WithTriviaFrom(expr));
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
47editor.ReplaceNode(node, editor.Generator.LiteralExpression(newDocCommentId).WithTriviaFrom(node));
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (2)
79return Increment((TExpressionSyntax)leftOfAssign, PreferPostfix(syntaxFacts, currentAssignment)).WithTriviaFrom(currentAssignment); 82return Decrement((TExpressionSyntax)leftOfAssign, PreferPostfix(syntaxFacts, currentAssignment)).WithTriviaFrom(currentAssignment);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
112conditionalExpression)).WithTriviaFrom(ifStatement);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
124conditionalPart.WithTriviaFrom(conditionalExpression));
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
157? WithName((TSimpleArgumentSyntax)argument.WithoutTrivia(), parameters[i].Name).WithTriviaFrom(argument)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (7)
src\Analyzers\VisualBasic\CodeFixes\AddAnonymousTypeMemberName\VisualBasicAddAnonymousTypeMemberNameCodeFixProvider.vb (1)
45inferredField.Expression).WithTriviaFrom(declarator)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedValuesCodeFixProvider.vb (2)
43Return modifiedIdentifier.WithIdentifier(newName).WithTriviaFrom(node) 48Return identifier.WithIdentifier(newName).WithTriviaFrom(node)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
43WithTriviaFrom(variable)
src\Analyzers\VisualBasic\CodeFixes\UseInferredMemberName\VisualBasicUseInferredMemberNameCodeFixProvider.vb (1)
30WithTriviaFrom(namedFieldInitializer)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\CastExpressionSyntaxExtensions.vb (1)
22Dim resultNode = innerNode.WithTriviaFrom(castNode)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
36.WithTriviaFrom(expression)
Microsoft.CodeAnalysis.VisualBasic.Features (14)
CodeRefactorings\SyncNamespace\VisualBasicChangeNamespaceService.vb (2)
42[new] = [new].WithTriviaFrom(old) 53[new] = [new].WithTriviaFrom(old)
ConvertAnonymousType\VisualBasicConvertAnonymousTypeToTupleCodeRefactoringProvider.vb (1)
41GetExpression(field)).WithTriviaFrom(field)
ConvertForToForEach\VisualBasicConvertForToForEachCodeRefactoringProvider.vb (1)
93collectionExpression).WithTriviaFrom(forStatement),
ConvertTupleToStruct\VisualBasicConvertTupleToStructCodeRefactoringProvider.vb (1)
51Dim newName = SyntaxFactory.IdentifierName(name).WithTriviaFrom(nameColonEquals.Name)
IntroduceUsingStatement\VisualBasicIntroduceUsingStatementCodeRefactoringProvider.vb (2)
60variables:=declarationStatement.Declarators).WithTriviaFrom(declarationStatement) 69variables:=Nothing).WithTriviaFrom(expressionStatement)
IntroduceVariable\VisualBasicIntroduceVariableService.Rewriter.vb (2)
62newNode.Expression.WithoutLeadingTrivia()).WithTriviaFrom(newNode) 80newNode.Expression.WithoutLeadingTrivia()).WithTriviaFrom(newNode)
src\Analyzers\VisualBasic\CodeFixes\AddAnonymousTypeMemberName\VisualBasicAddAnonymousTypeMemberNameCodeFixProvider.vb (1)
45inferredField.Expression).WithTriviaFrom(declarator)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedValuesCodeFixProvider.vb (2)
43Return modifiedIdentifier.WithIdentifier(newName).WithTriviaFrom(node) 48Return identifier.WithIdentifier(newName).WithTriviaFrom(node)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
43WithTriviaFrom(variable)
src\Analyzers\VisualBasic\CodeFixes\UseInferredMemberName\VisualBasicUseInferredMemberNameCodeFixProvider.vb (1)
30WithTriviaFrom(namedFieldInitializer)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
Simplification\Reducers\VisualBasicInferredMemberNameReducer.Rewriter.vb (2)
26Return SyntaxFactory.InferredFieldInitializer(node.Expression).WithTriviaFrom(node) 40Return node.WithNameColonEquals(Nothing).WithTriviaFrom(node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\CastExpressionSyntaxExtensions.vb (1)
22Dim resultNode = innerNode.WithTriviaFrom(castNode)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
36.WithTriviaFrom(expression)
Microsoft.CodeAnalysis.Workspaces (8)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (8)
77.WithTriviaFrom(expressionOrPattern); 102.WithTriviaFrom(expressionOrPattern); 179newBinaryExpressionSyntax = newBinaryExpressionSyntax.WithTriviaFrom(expressionNode); 189return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.ConstantPattern(generator.NullLiteralExpression().WithTriviaFrom(rightOperand))); 223generatorInternal.NotPattern(innerPattern.WithTriviaFrom(rightOperand))); 255newPattern = newPattern.WithTriviaFrom(pattern); 492return newLiteralExpression.WithTriviaFrom(expression); 567generator.NullLiteralExpression().WithTriviaFrom(type)));
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckNameofFixProvider.cs (2)
169var nameofExp = SyntaxFactory.ParseExpression($"nameof({name})").WithTriviaFrom(nameArg); 178var nameofExp = (InvocationExpressionSyntax)SyntaxFactory.ParseExpression($"nameof(a)").WithTriviaFrom(nameArg);