What's the right way to update Roslyn's Document while typing?
问题 What's the right way to update Roslyn's Document when user is typing new text? Should I call SourceText.WithChanges and then Document.WithText on each char, or is there a more efficient way? Unfortunately throttling is not an answer, see my question What's the most efficient way to use Roslyn's CompletionSevice when typing? where an API implies that SourceText / Document must be up to date on each char. 回答1: Doing SourceText.WithChanges on each character is probably your best bet, assuming