I have a color theme extension that I have created myself.
For the longest time I was able to just checkout the git repo into my extensions folder, and VS Code would recognize it.
Now all of a sudden (not sure exactly when the change occurred) VS Code will no longer automatically recognize my extension repo/folder that is added to the extensions folder.
I need to have the git repo sit directly in the extensions folder, so I can make tweaks to the theme in real time, and just commit them to git.
Is there a way I can restore this behaviour?
Indeed, you used to be able to copy/link an extension development folder into the ~/.vscode/extensions
directory instead of going through vsce package
and installing the resulting VSIX and it would just work (source).
At some point, it started becoming necessary to use the Developer: Install Extension from Location
(command in the command palette) (source)- to which you can pass the path to a packaged VSIX, or to an unpackaged extension directory. So you can still copy/link your unpackage extension directory into ~/.vscode/extensions/
, but you just need to add the step of using that install command inside VS Code.
Probably it has something to do with the ~/.vscode/extensions/extensions.json
file. After running the above command, the local extension will have an entry added in there. I think this has to do with the addition of Profiles. Profiles implementation work started around/before 1.72. The Developer: Install Extension from Location
was added circa 1.74. I'm not too familiar with the implementation of the internals of Profiles, but I think all profiles (including the default one) share the same extension installation location, and each profile can have a different notion of what extensions are actually "installed". I'm assuming (my best guess) that that feature complicated things and motivated each profile having its own extensions.json
file (actually, on second thought, that was probably at least partially by design from the beginning, since each profile's export needs to be able to record what extensions it includes), where the default profile just stores that file under ~/.vscode/extensions/extensions.json
, and non-default profiles store it under ~/.config/Code/User/profiles/<profile-hash>/extensions.json
. In particular, the back and forth between maintainers in issue ticket --extensions-dir is ignored for management commands #166147 and the commit that followed it, 23b25e9
, seem relevant and to back up(?) my understanding of what happened. It's also reflected in the release notes from 1.74, though it's a bit misleading in that it says the command is for installing VSIXes, where it also supports installing non-packaged extension directories (I verified this myself using one of the sample extensions). The command is even necessary to "locally" test extensions in vscode.dev (see related docs). I've poked the VS Code maintainers to improve documentation about this here.
Aside: VS Code 1.88 released a feature for "Local Workspace Extensions" that extension devs may or may not find useful. I don't think it's designed precisely for this use-case, but you can take a look and decide what works best for you.