Open sharwell opened 1 year ago
Thank you for creating this issue. Since you seem more knowledgeable in that area, what would you suggest would be a better solution? Is calling line.Snapshot.TextBuffer.CurrentSnapshot.GetText
better?
I wonder if I am hitting this too. Something seems to be freezing my editor (causing the window to fade out and eventually show the Windows "stopped responding" dialog) in VS Pro. I am not sure if it is IndentRainbow or not.
If you decide to try to fix this, I'd be willing to try it out. If not, thank you for the effort anyway. :)
Thank you for your input @szalapski! Do you have a way one could reproduce this? For example is it a specific project or file? That would make it easier for me to debug this and find the right API for the job
🔗 Originally reported as https://developercommunity.visualstudio.com/t/visual-studio-very-slow-after-last-updat/10232726
The following code should not call
GetText()
. This method produces both achar[]
andstring
representation of the document behind the scenes, leading to significant GC pressure and user-visible pauses in the UI.https://github.com/chingucoding/IndentRainbow/blob/f360b230b8bf49c74007a3047cc3dec555b7e1ec/src/IndentRainbow.Extension/Classification/Indent.cs#L112-L131