93

Just got an update for the Golang extension and it appears to be broken, reporting an error on a package main that's literally just a list of my imports with no useful information (see screenshot below). It's refusing to lint or do anything useful which is annoying.

screenshot of error in VS Code

So I want to quickly jump back to the previous version, how can I do this in VS Code? I can't seem to find it in the docs at all.

NB: I'm using VS Code version 1.10.1 with only the golang package. The code is valid golang.

wovano
  • 4,543
  • 5
  • 22
  • 49
Southclaws
  • 1,690
  • 2
  • 16
  • 25
  • You updated any previous used package ? – Dharani Dharan Mar 06 '17 at 13:08
  • no, only the golang package, no code changes either - code is valid golang and yes, vs code version 1.10.1 – Southclaws Mar 06 '17 at 13:12
  • did you see this line in the go ext readme (0.6.54): `Important Note: If you have recently upgraded to Go 1.7, you may need to run gocode close in your terminal to ensure Go completion lists continue to work correctly. See https://github.com/Microsoft/vscode-go/issues/441.` – RickyA Mar 06 '17 at 13:23
  • Ah, I thought this was unrelated and first try didn't work but after deleting and recompiling gocode and restarting vscode it works, thanks! edit: alright nope never mind, it came back in a random source file - time to open an issue... – Southclaws Mar 06 '17 at 15:23

3 Answers3

153

From v1.30 release notes: install previous versions of extensions.

You can now go back to a previous version of an extension if there are issues with the current version. VS Code provides an Install Another Version action on an installed extension which shows a dropdown of available versions.

The option to install another version is in the context menu. Or the gear icon for each extension. Or the Extension Page in vscode: Uninstall dropdown: Install another version....

For me when I do this - without "Disable Auto Updating Extensions" (I assume that the Debugger for Chrome is such an extension) it does not auto-update on reload or close/open but shows a button for that extension to install the latest version instead.

So it appears you don't have to disable all auto-updating extensions just to revert one extension to an older version and keep it at that older version. [leave a comment if you find that isn't true, thanks]

Update for vscode v1.75:

See pinning extensions (to a specific version):

Make sure you have extension autoupdates enabled and try pinning extensions to a specific version using following UI. Make sure extensions are not getting auto updated after pinning.

From CLI : Install a specific version using following format - code-insiders --install-extension eamodio.gitlens@13.1.1

From Extensions UI - Use *Install Another Version... action in the context menu of the installed extension.

Make sure the pinned version is synced across VS Code instances - Use Settings Sync feature to test this. To have different instances of VS Code on same machine, open VS Code from CLI using different user-data-dir and extensions-dir. Eg: code-insiders --user-data-dir <path> --extensions-dir <path>

Export and Import the profile with the pinned extension and make sure in the imported profile, extension is still pinned. Export and Import profile actions are available in the global activity context menu (gear).

Si it appears that regardless of the Disable Auto Updating Extensions setting, pinning/reverting to a previous version of an extension should result in that extension not updating.

revert extension 1

revert extension 2

Mark
  • 143,421
  • 24
  • 428
  • 436
  • 15
    Remember to disable automatic updates for extensions: Ctrl-Shift-P Extensions: Disable Auto Updating Extensions – cdjc Apr 18 '19 at 02:37
  • I still need to disable auto update to avoid new version come back, at vscode 1.63.2 – intijk Dec 21 '21 at 03:43
  • Is there a direct link possible to list out the same version history? – kyrlon May 09 '23 at 14:12
  • @kyrlon I don't think there is a way to do that, even within an extension. What are you trying to do, maybe there is an alternate way to accomplsh what you want? – Mark May 09 '23 at 18:30
  • I made a recent [post](https://stackoverflow.com/q/76211091/13642249), but eventually have a script to traverse back to older versions of an extension that matches a certain vs code version. – kyrlon May 09 '23 at 18:48
  • @Mark Turns out it is possible! Look at this guy's [answer](https://stackoverflow.com/a/76559642/13642249) – kyrlon Jun 28 '23 at 23:02
  • 1
    @kyrlon Good find. The command without the `-json` option apparently just shows the last 6 versions, which may be useful to you instead of all of them back to the beginning. – Mark Jun 29 '23 at 16:59
2

[EDIT] now it is supported -> see accepted answer

Currently downgrading is not (yet) supported.

However, you can uninstall the extension and then manually download and install a specific version by hand: https://code.visualstudio.com/docs/extensions/install-extension

And also this excellent answer: How to install VSCode extensions offline?

RickyA
  • 15,465
  • 5
  • 71
  • 95
1

The downgrade works, but there is an interesting exception. The new Ansible plugin is 2.0.58, and has a 'feature' called LightSpeed that allegedly enables AI assistance.

However, it basically insists that you login and give it access to your GitHub to work. So if you see the following message:

Sign in with Ansible LightSpeed to enable Ansible(1)

You need to 'Install Another Version...' and go back to 1.2.44 or your previous version. When vscode prompts for 'Reload Required', reload and this works. Here is a link to a GitHub issue where LightSpeed could not be disabled, and also prevented full functionality of the plugin.

https://github.com/ansible/vscode-ansible/issues/859

HOWEVER, if you do this at the CLI:

code --install-extension redhat.ansible@1.2.44

The output indicates success:

Installing extensions...
Updating the extension 'redhat.ansible' to the version 1.2.44
Installing extension 'redhat.ansible' v1.2.44...
(node:48416) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Extension 'redhat.ansible' v1.2.44 was successfully installed.

Then in the vscode console, it prompts for 'Reload Required'. But when you select it, it reloads, and then AUTOMATICALLY updates it back to the current 2.0.58.

Tested this back and forth at least a dozen times. Not sure if that one plugin is the only exception, but make sure to double-check versions when downgrading with the CLI, especially if it is the redhat.ansible plugin.

adamt8
  • 308
  • 1
  • 7