razor icon indicating copy to clipboard operation
razor copied to clipboard

Razor document formatting perf

Open NTaylorMullen opened this issue 4 years ago • 2 comments

  • Ask @ryanbrandenburg for the app to use
  • Insert the following on line 1105:
    public async Task Foo()
    {
                    SomeMethod();
    }
  • Format the document
  • Takes roughly 8-10s to format for a 1k line document

yW0VmNjiLT

NTaylorMullen avatar Oct 15 '21 21:10 NTaylorMullen

@davidwengier Assigning to you as this is pretty rough. When you're ready to tackle it you can reach out to me for the document/project. I'll send them to you offline now as well.

NTaylorMullen avatar Oct 15 '21 21:10 NTaylorMullen

A customer reported an interesting manifestation of the issue here: https://developercommunity.visualstudio.com/t/Writing-too-fast-skips-documentation-tem/1654948

Essentially, OnAutoInsert (and formatting the results) is taking long enough that the editor state has changed, and thus the edits are thrown away. So the we're doing the right thing and generating the write text to insert, and the editor is doing the right thing and not losing the customers keystrokes, which leaves formatting in the middle being the bad guy.

davidwengier avatar Feb 11 '22 05:02 davidwengier