flow updates squiggle locs on typing
flow updates squiggle locs on typing

Summary:
Situation: (1) the flow server has sent a squiggle at line 5; (2) the inserts a newline earlier in the document and introduces a parse error. Naturally, FlowLSP will send "live squiggles" to show the parse error immediately. And the way LSP works is that FlowLSP has to send every squiggle for the document at once - the live syntax squiggles superimposed atop the stale semantic squiggles.

But it has the wrong location for the semantic squiggle! Its record of the location doesn't take into account the fact that the user has inserted a character!

In many cases this isn't a problem since the editor is the one dealing with shifting squiggle spans. It only becomes an issue because (1) we want to send live diagnostics about syntax errors, (2) LSP forces us to send all squiggles rather than solely the syntax squiggles.

This diff fixes the problem, by having lspCommand track DidChange events and update squiggle spans itself for the squiggles that came from the server.

Reviewed By: pakoito

Differential Revision: D9948696

fbshipit-source-id: f6bdaaf47e9623bc1c7287c171f6c820cbf91de3

facebook/flow,jamesgpearce/flow,samwgoldman/flow,mroch/flow,jamesgpearce/flow,samwgoldman/flow,samwgoldman/flow,jamesgpearce/flow,mroch/flow,gabelevi/flow,mroch/flow,popham/flow,facebook/flow,AgentME/flow,gabelevi/flow,popham/flow,facebook/flow,jamesgpearce/flow,AgentME/flow,samwgoldman/flow,AgentME/flow,popham/flow,mroch/flow,mroch/flow,popham/flow,gabelevi/flow,mroch/flow,AgentME/flow,popham/flow,facebook/flow,facebook/flow,gabelevi/flow,jamesgpearce/flow,facebook/flow,samwgoldman/flow,jamesgpearce/flow,mroch/flow,popham/flow,samwgoldman/flow,samwgoldman/flow,AgentME/flow,gabelevi/flow,jamesgpearce/flow,popham/flow,facebook/flow,gabelevi/flow,gabelevi/flow