There's a synchronization issue somewhere: the first command (A) runs successfully, but then the sidecar doesn't properly represent the state after A correctly when it goes to run the second command (B), so it does the wrong thing.
Theoretically, the sidecar shouldn't change after it runs A, so most likely the state from before A is getting reapplied somehow. Thus we should:
In the meantime we've made temporary workarounds:
- I've added a check that the sidecar contents match the exterior contents before running a command. (Need to extend this to include selection state).
- @dyamito found that simply waiting between commands slightly also prevents the problem, adding to the theory that we're incorrectly sending several updates at once that are eventually consistent.
There's a synchronization issue somewhere: the first command (
A) runs successfully, but then the sidecar doesn't properly represent the state afterAcorrectly when it goes to run the second command (B), so it does the wrong thing.Theoretically, the sidecar shouldn't change after it runs
A, so most likely the state from beforeAis getting reapplied somehow. Thus we should:editor-state.jsonwhile a command is running.In the meantime we've made temporary workarounds: