Codelet logoCodelet

Extensions

The built-in extensions that add views, editors and tools to the workbench, and how to pass your own.

Extensions are opt-in objects you pass to the workbench's extensions option. Each built-in extension has its own package entry, so a workbench only pays for the ones you import — nothing else is bundled. See Using extensions for how to pass them, and the API for writing your own.

#Files and previews

#Shells and running code

#Language support

#Collaboration and sources

#The workbench itself

#Try it

This workbench runs three extensions together. It opens on the Extensions view — see what each one contributed, then click the Search icon and type greet.

#Adding extensions

Pass an array to extensions. Each entry is either an extension object or, for extensions that take options, the result of calling one:

import { search } from "codelet/extensions/search";
import { extensions } from "codelet/extensions/extensions";
import { logs } from "codelet/extensions/logs";
import { Workbench, FileSystem } from "codelet/workbench";

const workbench = new Workbench({
  parent: document.getElementById("app")!,
  fs: new FileSystem({ "/README.md": "# Hello" }),
  extensions: [search, extensions, logs({ level: "info" })],
});

Note

A few of these need something from the host: cross-origin isolation for a SharedArrayBuffer, a server to talk to, or a network call to a CDN or a third party. Each page says so up front.

Read more in API.