Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install VS Code extension during development?

I am developing an extension for VS Code. This extension is already good enough for me to use during daily work, but not good enough to be published (yet). Is there a canonical way to make an unpublished extension under development available to VS Code? Optimally, I would like to always have the current state of the code running.

I did find a way that seems to work, but I'm not sure whether this is a terrible hack or okay: Create a symbolic link in VS Code's extensions directory (~/.vscode/extensions on Linux) to the development directory. Is there a better/official way?

like image 871
A. Donda Avatar asked Jul 31 '26 23:07

A. Donda


2 Answers

You can package your extension (even if it's in development) using vsce with the command vsce package. This will create a .vsix file which you can install in your regular instance of VSCode in the marketplace menu (click on the ... icon at the top and select "Install from .vsix file).

If you need to view the logs of the extension, go to Help>Toggle Developer tools and use the console to view your extension's output (if there is any).

like image 199
Charles Avatar answered Aug 02 '26 15:08

Charles


VS Code can run the extension directly once it's detected. Just open extension.js and run the debugger. See the second step here: https://code.visualstudio.com/api/get-started/your-first-extension

Then, inside the editor, press F5. This will compile and run the extension in a new Extension Development Host window.

You do not need to package it nor run any command line scripts.

like image 38
fregante Avatar answered Aug 02 '26 17:08

fregante



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!