microsoft / vscode-go

An extension for VS Code which provides support for the Go language. We have moved to https://github.com/golang/vscode-go
Other
5.93k stars 648 forks source link

src/goLanguageServer.ts: respect configuration changes on server restart #3186

Closed stamblerre closed 4 years ago

stamblerre commented 4 years ago

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