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