dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.07k stars 4.04k forks source link

add TriviaTracker in SyntaxEditor or SyntaxGenerator #25844

Closed heejaechang closed 2 years ago

heejaechang commented 6 years ago

currently, each codefix/refactoring does its own logic to handle trivia when tree transform for code generation.

this makes each code fix/refactoring to have different degree of trivia handling and also different behavior.

this can't be 100% automated or make to have 100% same behavior. but we can provide some helper so that they have similar behavior.

we should have something that help in this area.

CyrusNajmabadi commented 2 years ago

This would need to go through an API proposal. in general, the reason we don't just make things public is because it increases maintenance costs and locks down our ability to change things in teh future. We can open things up, but we have a process that requests need to go through to make sure the appropriate people weigh in and the right API shape is determined and shipped.