A Sourcegraph extension is a single JavaScript file that runs in users' web browsers in a Web Worker and has an exported activate function. The JavaScript file is usually produced by compiling and bundling one or more TypeScript source files.
The Sourcegraph extension API (generated from sourcegraph.d.ts) is available to extensions by importing the sourcegraph module (import * as sourcegraph from 'sourcegraph' or require('sourcegraph')). Writing a Sourcegraph extension is very similar to writing an editor extension for VS Code.
- Extension API documentation (full API is in
sourcegraph.d.ts) - Set up your development environment
- Creating an extension
- Local development
- Contribution points (actions, menus, etc.)
- Extension manifest (
package.json) - Publishing an extension
- Debugging an extension
- Activation
- Builtin commands
- Sample extensions (
sourcegraph-extension-samples) - Cookbook (sample code)
- UX style guide
- Sourcegraph.com extension registry (most extensions link to their source repository)
- Sample Sourcegraph extensions (with source code)
- Issues labeled
extension-request