-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Extension is not deactivated during an extension upgrade #537
Comments
see also microsoft/vscode-go#26 |
@joaomoreno do we need a separate issue to track this requirement: https://twitter.com/jchannon/status/667283133318889472 i.e. to get a notification about available updates for extensions? |
There is one: |
Ah, perfect 👍 |
With 98473e0, VSCode's extension host will now call |
The PowerShell extension has added a deactivate() method but I don't see it getting called when attempting to upgrade my extension in 0.10.4. With [email protected] installed, I attempted to upgrade to [email protected] and didn't see my language server get a shutdown request (which should be caused by the deactivate method). Here's my main.ts file's deactivate method: https://github.com/PowerShell/vscode-powershell/blob/master/src/main.ts#L106 Did I implement this incorrectly? Should I instead create a disposable that calls the necessary shutdown method? Thanks! |
cc @dbaeumer since I'm using vscode-languageclient |
adding @alexandrudima |
@daviwil your implementation looks fine
Currently deactivate is only called when VS Code exits, it isn't called when you upgrade/reload. |
Yep, it definitely gets called during shutdown and also when I open a different workspace path. For me, the extension upgrade scenario was the biggest problem that To clarify, my extension should be deactivated before the extension upgrade process starts. |
Issue #567 tracks the deactivate on shutdown scenario. |
@daviwil the December update improved the way an extension is updated. The update is now installed into a new folder with the version suffix. Can you please verify whether this support addresse the issues with PowerShell/vscode-powershell#27. |
Yep, I noticed the new folder layout, that is an improvement! One question about the new behavior - after you download and unpack the extension into the new version-specific folder, do you attempt to delete the older verson's extension folder? If so, does it happen before or after VS Code restarts? The only way we would still have a problem is if VS Code attempts to delete the old extension folder before it restarts because my language server process would still be running at this point. |
@daviwil Deletion will only happen after VS Code restarts. |
Perfect! I'll be releasing a new update to my extension in the next week or two, so I'll let you know if I see any issues when attempting an upgrade at that time. Feel free to close this issue for now, I'm pretty confident that your changes will have fixed it. |
We need to support extension deactivation. Primary use cases will be uninstallation and update.
Users are already hitting issues due to it:
@daviwil
The text was updated successfully, but these errors were encountered: