Sourcegraph extension authoring

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. See the Sourcegraph extension samples repository for some examples.

Topics

Tutorials

The Sourcegraph.com extension registry is also a helpful source of inspiration and working code samples from existing extensions.