Open DartBot opened 9 years ago
Comment by stereotype441
After several attempts I was able to reproduce the bug by typing a single character at the top of the file, waiting a short amount of time (perhaps ~0.5 second), and then pressing Alt-Z to undo. However, the repro is not very reliable. I suspect that the bug is very sensitive to the exact timing of the keypresses.
I will continue investigating.
Set owner to @stereotype441.
Issue by stereotype441 Originally opened as https://github.com/dart-lang/sdk/issues/22223
I just encountered a sequence of actions which caused editor to send an improper overlay state to the analysis server. Here's what I did:
At this point I noticed that my semantic highlighting was incorrect.
Looking at the analysis server log, I see that during step 2, editor sent an "analysis.updateContent" message to the server containing instructing it to add an overlay for the file, with contents containing the text "pub" that I erroneously typed. This is as expected.
However, I would have expected that to be followed by an "analysis.updateContent" message instructing the server to remove the overlay at the time I typed Cmd-Z to undo. There was no such message.
This left the server and the editor in an inconsistent state--the server thought the file had unsaved changes (the three accidentally typed characters), where as the editor thought that the file was in the "saved" state.
Speculation: perhaps the reconciler does not properly detect a transition from "unsaved" to "saved" state when that transition happens as the result of an undo.
I have saved the analyzer log. I will now see if I can reproduce the bug.