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

Restart language server automatically when its configuration changes #3211

Closed stamblerre closed 4 years ago

stamblerre commented 4 years ago

This change replaces the messages that tell the user to reload with automatic calls to the restart function. This way, config changes are automatically reflected - I tested it out locally and it worked pretty nicely. Most of the code to do this was already there, it was just a matter of reordering it correctly and making sure to deregister/re-register the default providers. I also added the mtime check for the language server binary as part of the config.

The only other thing that might be still missing is automatic restarts when the language server binary changes on disk, but that might be too much - probably wouldn't be intuitive for the user.

After this is merged, it will be really simple to implement https://github.com/microsoft/vscode-go/issues/3128.

Sorry about the huge PR! It's a lot of code shuffling, and there's one function that I moved back to its original place after https://github.com/microsoft/vscode-go/pull/3186 - sorry about that!

/cc @hyangah

stamblerre commented 4 years ago

Fixed! Sorry about that.

stamblerre commented 4 years ago

This has been merged through the nightly, so I'll abandon this here. There's no reason that this needs to be rushed into the next release.