VSCode: How to fix Python extension version for Python 2 compatibility and prevent automatic upgrade? - visual-studio-code

I have a legacy code using Python 2. The last version of VSCode Python extension that supports Python 2 is v2022.2.1924087327
It is very easy to change the extension to an older version.
My problem is that VSCode always automatically updates the extension. Since I'm using it in a remote machine, when I loose connection, it automatically updates the extension, and I must manually downgrade it, reload the window and start it again.
Is it possible to fiz the version of my Python extension in VSCode?

I've just found how to prevent extensions to automatically upgrade.
And I just set:
{
"extensions.autoUpdate": false
}
It will now ask me for each extension upgrade, it is an annoyance, but at least I can control it.
If someone finds how to disable auto update just for the Python extension, I'll mark it as the correct answer.

Related

How to determine which VSCode extensions were installed by default?

I'm trying to "reset" my VSCode configuration as it pertains to Java without having to reinstall VSCode entirely, so I am wondering how to determine which plugins were default (installed at VSCode install time) and which were installed by me?
I have tried:
Determining the date of installation of the extensions (but I can't find it).
Using some kind of sort by/show only defaults feature (doesn't seem to exist).

Why cannot I use the Vim VSCode extension over ssh or wsl?

I cannot install the Vim VSCode extension on my headless machine through VSCode remote development nor in WSL. I think I used to be able to but I uninstalled it once and since then I haven't been able to install it again. I can only install and uninstall on my Windows computer but not remotely: when I click the button to install Windows extensions to server, the Vim VSCode extension is not part of the batch:
Edit: actually the extension stopped working in Windows as well without obvious reason.
Here is a list of my extensions: maybe I introduced incompatibilities I am not aware of:
I wonder how to get a JSON list of the extensions by the way :(
I might be wrong but I don't believe the normal VSCodeVim extension requires Vim itself to be installed as it just emulates it, so it shouldn't need installed in the remote environment as long as it is installed/enabled which it looks to be. Is it not working?
There was a bug in the settings JSON file. There was some syntax error, possibly caused by the installation of some other extension.

How to cancel vscode extention update?

I'm working on a C++ project(on remote) so I heavily rely on C/C++ extension.
Recently they probably released some new component for the extension.
This triggered auto update but the Downloading stucked.
Now my C/C++ is useless.
I've tried disable/enable, uninstall/install, even rebooting the computer.
None worked.
So how can I cancel this update and get my extension back.
I've switched off extension auto-update so this won't happen again.
as far as i know there's no way currently to cancel an extension upgrade...
rather you can downgrade it and stop the extensions update
This would be helpful for downgrading

Custom node version to run VSCode extensions

I'm making a vscode extension for my personal use. I'd really like to use a more recent node version. However, I'm not sure how does VSCode chooses which node version to use.
The only node.js that I have installed is 8.1.3. But when I debug the extension, I see that VSCode uses 7.*.* (via process.version).
I've been searching documentation for an hour, so far, without luck. Any help is appreciated.
This is not possible. Quoting the reply of one of the team members (Andre Weinand) in #18253:
VS Code runs extensions on the node version that is built into electron (on which VS Code is based). This cannot be changed.

VS Code - how to rollback extension/install specific extension version

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.
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.
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.
[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?