Completely uninstall VS Code extensions

Since the latest release of VS Code, I get an error whenever I open a C# file (I have installed the csharp language extension, powered by OmniSharp). This is the error I get:

enter image description here

I tried uninstalling the extension and re-install it, same problem. I uninstalled the application altogether and reinstalled it - but when I do that, my extensions are still installed (for instance Python and reStructuredText were still there). I uninstalled yet again and deleted the %USER%\AppData\Roaming|Local\Code directory. When I reinstalled, the extensions were still there.

How do I completely remove the installed extensions? I'd like to be sure I'm starting from scratch before opening a bug for the OmniSharp extension crash.

145931 次浏览

原来这些扩展名存储在% USER% . vscode 扩展名下。删除这些扩展名可以删除它们。

视窗: %USER%\\.vscode\extensions (或) %USERPROFILE%\.vscode\extensions

Linux/MAC 扩展的位置: ~/.vscode/extensions

对我有用,但是环境变量是 %USERPROFILE%\.vscode\extensions

你可以在以下地址删除它们:

Windows :% USERPROFILE% . vscode 扩展

Mac : ~/. vscode/

Linux : ~/. vscode/xml

All the answers above are correct, but for a beginner, I wanted to add that all you have to do is, run this command in your terminal to remove 全部 extensions/themes.

用于 Mac/Linux

rm -rf ~/.vscode/extensions

适用于视窗

rmdir %USERPROFILE%\.vscode\extensions /s

为了 Mac

Finder -> Go to Folder -> Go

enter image description here enter image description here

粘贴目录 ~/.vscode/extensions

你已到达目的地。

所有工作为我,但有一个问题需要修复,以获得 Windows 使用的目录:

% USERPROFILE% . vscode 扩展名,

就是这样。

如果您使用 VS 代码-内部人员扩展名在文件夹: 窗户

% USERPROFILE% . vscode-inside 扩展名

MAC/Linux:

~/. vscode-内部人员/扩展

首先,您必须找到 vscode 的资源。
The resources usually located in /usr/share (linux).
因此,您必须 cd 到/usr/share/code/resources/app 才能查看扩展目录。
现在,只需使用 rm-rf 扩展名删除扩展名目录。

如果您想在 WSL2上完全删除 Windows10中的 VSCode 扩展,那么您需要查看一些额外的目录:

~/. vscode-server/data/CachedExtensionVSIXs/
~/. vscode-server/data/User/globalStorage/
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

对于 Windows-Users username.vscode 扩展 您可以删除不需要的扩展名。 然后点击隐藏的项目,然后按照下面的说明- 此 PC-> C: 用户用户名 AppData 漫游代码 CachedExtensionVSIX 和 删除卸载的文件。

If you are using Linux then try:

code --list-extensions | while read extension;
do
code --uninstall-extension $extension --force
done

在 Windows 上你可以做(不要尝试) :

for /f "usebackq tokens=*" %f in (`code --list-extensions`) do code --uninstall-extension %f --force

I found the following to be effective:

First, locate the extension ID:

code --list-extensions

然后,卸载它:

code --uninstall-extension ID

注意: 您必须将 ID 替换为您在第一步中发现的 ID。

艾哈迈德的回答的一个行变体:

code --list-extensions | xargs -L 1 code --uninstall-extension