Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow max 5 seconds for server to shutdown. #628

Merged
merged 1 commit into from
Sep 5, 2018
Merged

Allow max 5 seconds for server to shutdown. #628

merged 1 commit into from
Sep 5, 2018

Conversation

yaohaizh
Copy link
Collaborator

@yaohaizh yaohaizh commented Sep 5, 2018

Currently, the server will immediately be killed by client when call stop, this will prevent server from saving status. Mediate this issue by following microsoft/vscode#35196

The disposable assumes that everything can be executed sync which is not the case in the LSP. We later added async deactivate to VS Code's API which needs to be used for the LSP client. I might want to consider removing the return type form start in a version that allows breakage to make this more clear.

So for you that means that you shouldn't push the disposable into the array but implement a deactivate method for the extension and return the promise that is returned from the stop method. Then VS Code will wait max 5 seconds for your server to shutdown.

Signed-off-by: Yaohai Zheng <yaozheng@microsoft.com>
@fbricon
Copy link
Collaborator

fbricon commented Sep 5, 2018

Seems to work as expected, merging.
Thanks @yaohaizh!

@yaohaizh yaohaizh deleted the yaohai_dev branch September 12, 2018 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants