gpt4 book ai didi

visual-studio-code - 卸载 vscode 扩展的钩子(Hook)/事件

转载 作者:行者123 更新时间:2023-12-03 00:11:13 24 4
gpt4 key购买 nike

我在 vscode 文档中没有看到任何有关“卸载 Hook ”的内容。基本上,我有一个扩展需要在卸载时对系统的文件系统进行一些清理,但如果只是停用则不需要。 (关闭 vscode)。

最佳答案

今年在 VS Code 1.21 版本中添加了这个钩子(Hook):Extension uninstall hook

If your extension has some clean ups to be done when it is uninstalled from VS Code, you can now do that by registering a node script to the uninstall hook vscode:uninstall under scripts section in extension's package.json.

{
"scripts": {
"vscode:uninstall": "node ./out/src/lifecycle"
}
}

This script gets executed when the extension is completely uninstalled from VS Code which is when VS Code is restarted (shutdown and start) after the extension is uninstalled.

关于visual-studio-code - 卸载 vscode 扩展的钩子(Hook)/事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46654786/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com