71 references to WithTriviaFrom
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
AbstractOrderModifiersCodeFixProvider.cs (1)
71
.Select((t, i) => t.
WithTriviaFrom
(modifiers[i])));
AbstractUseCompoundAssignmentCodeFixProvider.cs (1)
92
compoundOperator.
WithTriviaFrom
(equalsToken),
SyntaxGeneratorExtensions_Negate.cs (2)
201
newToken.
WithTriviaFrom
(operatorToken));
230
var newTokenWithTrivia = newToken.
WithTriviaFrom
(operatorToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (13)
ConvertToRecordEngine.cs (1)
293
? recordKeyword.
WithTriviaFrom
(typeDeclaration.Keyword)
CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
122
var newCloseParen = SyntaxFactory.Token(SyntaxKind.CloseParenToken).
WithTriviaFrom
(parenthesizedExpression.CloseParenToken);
CSharpAsAndMemberAccessCodeFixProvider.cs (1)
87
Token(SyntaxKind.IsKeyword).
WithTriviaFrom
(asExpression.OperatorToken),
CSharpRemoveUnusedValuesCodeFixProvider.cs (3)
54
return identifierName.WithIdentifier(newName.
WithTriviaFrom
(identifierName.Identifier));
73
return variableDeclarator.WithIdentifier(newName.
WithTriviaFrom
(variableDeclarator.Identifier));
82
return catchDeclaration.WithIdentifier(newName.
WithTriviaFrom
(catchDeclaration.Identifier));
CSharpUseCollectionInitializerCodeFixProvider.cs (1)
79
.
WithTriviaFrom
(expressionStatement.SemicolonToken);
CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (2)
67
SyntaxFactory.Token(SyntaxKind.QuestionQuestionEqualsToken).
WithTriviaFrom
(assignment.OperatorToken),
114
compoundOperator.
WithTriviaFrom
(assignment.OperatorToken),
CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
109
Token(SyntaxKind.IsKeyword).
WithTriviaFrom
(binary.OperatorToken),
CSharpUseObjectInitializerCodeFixProvider.cs (1)
74
.
WithTriviaFrom
(expressionStatement.SemicolonToken);
CSharpUseRangeOperatorCodeFixProvider.cs (2)
99
Token(SyntaxKind.OpenBracketToken).
WithTriviaFrom
(argList.OpenParenToken),
101
Token(SyntaxKind.CloseBracketToken).
WithTriviaFrom
(argList.CloseParenToken));
Microsoft.CodeAnalysis.CSharp.Features (27)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
138
return rewrittenNode.WithSettingToken(SyntaxFactory.Token(SyntaxKind.DisableKeyword).
WithTriviaFrom
(rewrittenNode.SettingToken));
143
return rewrittenNode.WithSettingToken(SyntaxFactory.Token(SyntaxKind.RestoreKeyword).
WithTriviaFrom
(rewrittenNode.SettingToken));
ConvertAnonymousType\CSharpConvertAnonymousTypeToClassCodeRefactoringProvider.cs (2)
41
SyntaxFactory.Token(SyntaxKind.OpenParenToken).
WithTriviaFrom
(anonymousObject.OpenBraceToken),
43
SyntaxFactory.Token(SyntaxKind.CloseParenToken).
WithTriviaFrom
(anonymousObject.CloseBraceToken));
ConvertAnonymousType\CSharpConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (3)
33
SyntaxFactory.Token(SyntaxKind.OpenParenToken).
WithTriviaFrom
(anonCreation.OpenBraceToken),
35
SyntaxFactory.Token(SyntaxKind.CloseParenToken).
WithTriviaFrom
(anonCreation.CloseBraceToken))
50
SyntaxFactory.Token(SyntaxKind.ColonToken).
WithTriviaFrom
(nameEquals.EqualsToken));
ConvertForToForEach\CSharpConvertForToForEachCodeRefactoringProvider.cs (1)
120
SyntaxFactory.Token(SyntaxKind.ForEachKeyword).
WithTriviaFrom
(forStatement.ForKeyword),
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
72
switchKeyword: Token(SyntaxKind.SwitchKeyword).
WithTriviaFrom
(ifStatement.IfKeyword),
ConvertToRecordEngine.cs (1)
293
? recordKeyword.
WithTriviaFrom
(typeDeclaration.Keyword)
CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
122
var newCloseParen = SyntaxFactory.Token(SyntaxKind.CloseParenToken).
WithTriviaFrom
(parenthesizedExpression.CloseParenToken);
CSharpAsAndMemberAccessCodeFixProvider.cs (1)
87
Token(SyntaxKind.IsKeyword).
WithTriviaFrom
(asExpression.OperatorToken),
CSharpRemoveUnusedValuesCodeFixProvider.cs (3)
54
return identifierName.WithIdentifier(newName.
WithTriviaFrom
(identifierName.Identifier));
73
return variableDeclarator.WithIdentifier(newName.
WithTriviaFrom
(variableDeclarator.Identifier));
82
return catchDeclaration.WithIdentifier(newName.
WithTriviaFrom
(catchDeclaration.Identifier));
CSharpUseCollectionInitializerCodeFixProvider.cs (1)
79
.
WithTriviaFrom
(expressionStatement.SemicolonToken);
CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (2)
67
SyntaxFactory.Token(SyntaxKind.QuestionQuestionEqualsToken).
WithTriviaFrom
(assignment.OperatorToken),
114
compoundOperator.
WithTriviaFrom
(assignment.OperatorToken),
CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
109
Token(SyntaxKind.IsKeyword).
WithTriviaFrom
(binary.OperatorToken),
CSharpUseObjectInitializerCodeFixProvider.cs (1)
74
.
WithTriviaFrom
(expressionStatement.SemicolonToken);
CSharpUseRangeOperatorCodeFixProvider.cs (2)
99
Token(SyntaxKind.OpenBracketToken).
WithTriviaFrom
(argList.OpenParenToken),
101
Token(SyntaxKind.CloseBracketToken).
WithTriviaFrom
(argList.CloseParenToken));
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (4)
337
var newOperator = SyntaxFactory.Token(SyntaxKind.LessThanToken).
WithTriviaFrom
(outerBinary.OperatorToken);
347
var newOperator = SyntaxFactory.Token(SyntaxKind.GreaterThanToken).
WithTriviaFrom
(outerBinary.OperatorToken);
372
var newOperator = SyntaxFactory.Token(newOperatorKind).
WithTriviaFrom
(condition.OperatorToken);
395
var newOpToken = SyntaxFactory.Token(newKind).
WithTriviaFrom
(opToken);
SpellCheck\CSharpSpellcheckCodeFixProvider.cs (1)
57
=> SyntaxFactory.Identifier(newName).
WithTriviaFrom
(nameToken);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
2204
return SyntaxFactory.Token(token.Kind()).
WithTriviaFrom
(rewrittenToken);
Microsoft.CodeAnalysis.Features (4)
AbstractOrderModifiersCodeFixProvider.cs (1)
71
.Select((t, i) => t.
WithTriviaFrom
(modifiers[i])));
AbstractUseCompoundAssignmentCodeFixProvider.cs (1)
92
compoundOperator.
WithTriviaFrom
(equalsToken),
AddImport\References\Reference.cs (1)
91
var newIdentifier = generator.IdentifierName(SearchResult.DesiredName).GetFirstToken().
WithTriviaFrom
(identifier);
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
117
.
WithTriviaFrom
(numericToken);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (6)
VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (2)
117
SyntaxFactory.Token(SyntaxKind.FunctionKeyword).
WithTriviaFrom
(subStatement.SubOrFunctionKeyword),
127
SyntaxFactory.Token(SyntaxKind.FunctionKeyword).
WithTriviaFrom
(node.EndSubOrFunctionStatement.BlockKeyword))
VisualBasicMakeMethodSynchronousCodeFixProvider.vb (2)
69
SyntaxFactory.Token(SyntaxKind.SubKeyword).
WithTriviaFrom
(functionStatement.SubOrFunctionKeyword),
82
SyntaxFactory.Token(SyntaxKind.SubKeyword).
WithTriviaFrom
(node.EndSubOrFunctionStatement.BlockKeyword))
VisualBasicUseIsNotExpressionCodeFixProvider.vb (2)
62
SyntaxFactory.Token(SyntaxKind.IsNotKeyword).
WithTriviaFrom
(isExpression.OperatorToken),
70
SyntaxFactory.Token(SyntaxKind.IsNotKeyword).
WithTriviaFrom
(typeOfIsExpression.OperatorToken),
Microsoft.CodeAnalysis.VisualBasic.Features (14)
ConvertAnonymousType\VisualBasicConvertAnonymousTypeToClassCodeRefactoringProvider.vb (2)
37
SyntaxFactory.Token(SyntaxKind.OpenParenToken).
WithTriviaFrom
(initializer.OpenBraceToken),
39
SyntaxFactory.Token(SyntaxKind.CloseParenToken).
WithTriviaFrom
(initializer.CloseBraceToken))
ConvertAnonymousType\VisualBasicConvertAnonymousTypeToTupleCodeRefactoringProvider.vb (3)
28
SyntaxFactory.Token(SyntaxKind.OpenParenToken).
WithTriviaFrom
(anonCreation.Initializer.OpenBraceToken),
30
SyntaxFactory.Token(SyntaxKind.CloseParenToken).
WithTriviaFrom
(anonCreation.Initializer.CloseBraceToken)).
52
SyntaxFactory.Token(SyntaxKind.ColonEqualsToken).
WithTriviaFrom
(namedField.EqualsToken))
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (2)
146
SyntaxFactory.IdentifierName(SyntaxFactory.Identifier(propertyName).
WithTriviaFrom
(nameToken)),
175
SyntaxFactory.IdentifierName(SyntaxFactory.Identifier(propertyName).
WithTriviaFrom
(nameToken)),
SpellCheck\VisualBasicSpellCheckCodeFixProvider.vb (1)
80
Return SyntaxFactory.Identifier(newName).
WithTriviaFrom
(nameToken)
VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (2)
117
SyntaxFactory.Token(SyntaxKind.FunctionKeyword).
WithTriviaFrom
(subStatement.SubOrFunctionKeyword),
127
SyntaxFactory.Token(SyntaxKind.FunctionKeyword).
WithTriviaFrom
(node.EndSubOrFunctionStatement.BlockKeyword))
VisualBasicMakeMethodSynchronousCodeFixProvider.vb (2)
69
SyntaxFactory.Token(SyntaxKind.SubKeyword).
WithTriviaFrom
(functionStatement.SubOrFunctionKeyword),
82
SyntaxFactory.Token(SyntaxKind.SubKeyword).
WithTriviaFrom
(node.EndSubOrFunctionStatement.BlockKeyword))
VisualBasicUseIsNotExpressionCodeFixProvider.vb (2)
62
SyntaxFactory.Token(SyntaxKind.IsNotKeyword).
WithTriviaFrom
(isExpression.OperatorToken),
70
SyntaxFactory.Token(SyntaxKind.IsNotKeyword).
WithTriviaFrom
(typeOfIsExpression.OperatorToken),
Microsoft.CodeAnalysis.Workspaces (2)
SyntaxGeneratorExtensions_Negate.cs (2)
201
newToken.
WithTriviaFrom
(operatorToken));
230
var newTokenWithTrivia = newToken.
WithTriviaFrom
(operatorToken);