Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

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

Merged
merged 9 commits into from
Apr 26, 2020
Merged

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

merged 9 commits into from
Apr 26, 2020

Conversation

stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Apr 17, 2020

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

Change-Id: Ifed3c145e4edb1f6e71efff9ca51521163446f0e
Change-Id: I9023ccef107f53048c0cd3ff3a4baf9e975c728d
Change-Id: I0b1e88e7befce2d2fd62f351ec8ab7cecb39cba8
Change-Id: I6d233a9ed13ba6acd1d9e9d0524d960722b9d9a9
Change-Id: I99993d091078706182073b52e9cf12285d6e0efe
Change-Id: I7c1a85756167cc410f37632013d13b2a0695b9fe
Change-Id: Ibe824d151ea5b91268d4da6c1bed60f725cb2fcc
Change-Id: I4f1581ccb556ab8f28d20a6d5782777e33a97f0e
Change-Id: Iddd036a2c1bb16d79a3608856af9b387490e9bfd
@ramya-rao-a ramya-rao-a merged commit 7a57e56 into microsoft:master Apr 26, 2020
@stamblerre stamblerre deleted the restart-3 branch April 28, 2020 05:48
gopherbot referenced this pull request in golang/vscode-go May 6, 2020
…nges

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 #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 #3186 - sorry about that!

/cc @hyangah

Change-Id: I258dbd3a62d21da30129c08dd840d8e7ea2848e8
GitHub-Last-Rev: 29fd4d6
GitHub-Pull-Request: #24
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/232598
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants