Currently, document diagnostics is received asynchronously. Hide notifies LSP server about opening a file in one goroutine and listens for diagnostics in another. We didn't know how fast LSP servers would respond so we simply put the thread into sleep for 1 sec. Now we see that LSP servers (at least the ones we use) return diagnostics in less than 100 ms and we also know how to use switch statements in Go (talking about myself mostly :)
I propose we revisit our 1-sec-sleep solution and reimplement getting diagnostics properly with a switch statement thus reducing latency.
Currently, document diagnostics is received asynchronously. Hide notifies LSP server about opening a file in one goroutine and listens for diagnostics in another. We didn't know how fast LSP servers would respond so we simply put the thread into sleep for 1 sec. Now we see that LSP servers (at least the ones we use) return diagnostics in less than 100 ms and we also know how to use
switch
statements in Go (talking about myself mostly :)I propose we revisit our 1-sec-sleep solution and reimplement getting diagnostics properly with a switch statement thus reducing latency.