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