@openctx/vscode-lib
TypeScript icon, indicating that this package has built-in type declarations

0.0.29 • Public • Published

OpenCtx library for VS Code extensions

The @openctx/vscode-lib npm package is a library that lets VS Code extensions use OpenCtx functionality. The OpenCtx VS Code extension uses this library.

Usage

Status: experimental, for use by VS Code extension authors only (not end users)

  1. Add @openctx/vscode-lib as a dependency to your VS Code extension.
  2. In your extension's activate function, call createController({...}).
  3. Add the relevant contributions to your extension's package.json.

See the OpenCtx VS Code extension source code for an example.

Developing this library and your VS Code extension

If you want your VS Code extension to automatically incorporate your latest local changes to this package, you can use pnpm link.

In your VS Code extension's package directory, run the following (where $OPENCTX is the path to the openctx repository root):

cd path/to/your/vscode/extension
pnpm link $OPENCTX/lib/client
pnpm link $OPENCTX/lib/schema
pnpm link $OPENCTX/lib/protocol
pnpm link $OPENCTX/client/vscode-lib

Known issues

  • Only 1 activated extension can use this library at a time. If a second extension using this library tries to activate, it will encounter name collisions in the commands it registers.
  • Providers that are implemented as JavaScript programs must be bundled to CommonJS to be used with VS Code. (ESM-bundled JavaScript providers only work with the VS Code debug extension host.)

Development

Readme

Keywords

none

Package Sidebar

Install

npm i @openctx/vscode-lib

Weekly Downloads

327

Version

0.0.29

License

Apache-2.0

Unpacked Size

92 kB

Total Files

63

Last publish

Collaborators

  • sqs
  • sourcegraph-bot
  • mualam
  • keegan-src