Our team is looking to develop a dedicated VSCode extension for our project, but we do not wish to publish it to the VSCode Marketplace every time. Therefore, we are hoping to have a local plugin runner that can execute the extension locally.
- Develop your own extension which exports a function named
activate
that takes in avscode.ExtensionContext
and avscode
object and an optionaldeactivate
function. See VSCode Extension Docs for details. The extension script must use CommonJS module and do notrequire('vscode')
directly.
/**
* @param {import('vscode').ExtensionContext} ctx
* @param {import('vscode')} vscode
*/
async function activate(ctx, vscode) {
ctx.subscriptions.push(
vscode.commands.registerCommand('local-extension.pickAndEcho', async () => {
const selection = await vscode.window.showQuickPick(['1', '2', '3']);
vscode.window.showInformationMessage(
`Hello World from local-extension, you picked ${selection}`
);
})
);
}
module.exports = {
activate,
};
- Simply place your developed
index.js
into the.vscode/local-extension
directory. The Local Extension Runner will automatically detect and execute your extension upon starting VSCode.
Presently, the runner is only able to execute the JavaScript files of local extensions.
As a result, any features that rely on contributions
within the package.json
will not be operable.
Initial release.
Pass vscode
to activate
function.
Fix Disposable leakage, add error details when activating extension error happens.
Optimize local extension ExtensionContext
creation.
Support local extensions to store their settings in "local-extension-runner.extensions.settings".