As a precursor to https://golang.org/cl/222418, I wanted to extract the logic to start the language server into the restart function. This way, server restarts will account for changes in the configs, flags, etc. Also, I think it simplifies the logic of starting the server because I made it handle the case when there is no server running yet.
Some possible issues are (1) I had to extract a number of global variables to make this work, and (2) I had to add a dependency on deep-equal in order to correctly diff the environment.
As a precursor to https://golang.org/cl/222418, I wanted to extract the logic to start the language server into the restart function. This way, server restarts will account for changes in the configs, flags, etc. Also, I think it simplifies the logic of starting the server because I made it handle the case when there is no server running yet.
Some possible issues are (1) I had to extract a number of global variables to make this work, and (2) I had to add a dependency on deep-equal in order to correctly diff the environment.
Original change here: https://go-review.googlesource.com/c/vscode-go/+/227279.
/cc @hyangah