Some of the getLeadingTrivia() and getTrailingTrivia() calls return a new array of trivia, which means plugins don't have an easy way to manipulate that list without digging around in the leadingTrivia of each statement (or child expression). For example, a plugin that wants to prepend a comment to the start of every function, or delete all leading comments for a given statement.
How should we handle something like this with the plugin system and the new v1 comments-as-trivia model?
Some of the
getLeadingTrivia()
andgetTrailingTrivia()
calls return a new array of trivia, which means plugins don't have an easy way to manipulate that list without digging around in the leadingTrivia of each statement (or child expression). For example, a plugin that wants to prepend a comment to the start of every function, or delete all leading comments for a given statement.How should we handle something like this with the plugin system and the new v1 comments-as-trivia model?