VS Code Extension Template
This repository is a minimal, batteries-included starting point for building Visual Studio Code extensions with TypeScript. It keeps the build pipeline, linting, automated tests, and documentation wiring in place while leaving the extension logic intentionally small so you can replace it with your own features.
What is included?
Sample commands (
extension-template.sayHelloandextension-template.showWelcomePanel) that demonstrate command registration and a basic Webview panel.TypeScript toolchain with ESLint, Prettier, Vitest, and TypeDoc ready to run.
End-to-end harness powered by
@vscode/test-electronto validate activation.Documentation pipeline using Sphinx and TypeDoc so you can publish API docs and project guides.
CI helpers and Makefile to keep formatting, linting, packaging, and docs generation repeatable.
Getting started
Install dependencies
npm installRun the sample extension
Press
F5in VS Code to launch a development host.Run the
Extension Template: Say Hellocommand from the Command Palette.Open the
Extension Template: Open Welcome Panelcommand to see the sample Webview content.
Replace the template code
Update
src/extension.tswith your activation logic and commands.Swap out
src/welcomePanel.tsand the assets undermedia/to build your own UI.Change
package.jsonfields (name, display name, publisher, repository, activation events, and contributed settings) to match your project.
Scripts
These scripts are defined in package.json:
npm run compile– build the extension intoout/.npm test– run coverage, generate the coverage summary, and execute E2E tests.npm run lint/npm run lint:fix– lint the codebase.npm run format/npm run format:check– apply or verify Prettier formatting.npm run docs:typedoc– generate API documentation intodocs/build/typedoc.npm run lint:docs– spell-check Markdown files and docs sources.npm run test:e2e– run the VS Code integration tests via@vscode/test-electron.
Contributing your own extension
Use
typedoc.jsonto customize API doc output for your project.Update the docs under
docs/source/to describe your extension’s features. Each file includes template sections you can replace.Adjust the tests in
tests/unit,tests/integration, andtests/e2eto cover your extension behavior.Swap the sample settings under
contributes.configurationwith your own configuration schema.
Example using this
https://github.com/ascillato/VSCode-Logger