-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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 needs to be notified when it gets uninstalled #35006
Comments
@akaroml Not sure why do you need to Uninstall listener here. Actually when an extension depends on another extension, you can add it as a dependency in It looks to me that in your case B depends on A and A wants to do some clean up when B is uninstalled. This is showing some cyclic dependencies. @aeschli FYI |
This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our guidelines for filing issues. Thank you for your contributions. |
I have a different use case but the same request for an uninstall life-cycle hook/event. I have an extension that needs to clean up some dirs/files it creates on the OS when uninstalling but should leave alone if simply deactivating (closing a vscode instance). |
Makes sense |
Related #14444 |
Now you can provide node script (javascript) to run after the extension is uninstalled, using the property Example "scripts": {
"vscode:prepublish": "tsc -p ./",
"vscode:uninstall": "node ./out/src/extensionUninstall"
}, Using this hook, you can clean up the stuff that your extension has created. |
@sandy081 "Using this hook, you can clean up the stuff that your extension has created." I can't clean up vs code user settings on that hook. In my case, i add some settings. It says that it can not find 'vscode' module when that hook runs. Should i go the user.settings path and modify with plain node js? |
@GabrielBB Yes, this hook does not provide you access to vscode api. Please create a new feature request for that. |
When an extension is uninstalled, it needs to be notified of the uninstall event and do some cleanup before it is removed.
Here's the scenario. We have extension B which register some Java component in extension A. So when B is uninstalled, we would like to unregister B from A. Otherwise, A would attempt to load B's Java component in the next run, when B is already removed.
In our case, A is the Java Language Support from RedHat. B is the new Java debugger from Microsoft. Both ship Java artifacts which contain the real logic. So it's very important for the registration/unregistration to happen correctly.
The text was updated successfully, but these errors were encountered: