Skip to content

VS Code Extension Activation and Contributions

YarCraSy edited this page Jul 8, 2026 · 2 revisions

Previous page: Overview

Activation and Contributions

Entry

package.json declares:

  • main: ./dist/Extension.js.
  • activity bar container: deepseek-copilot-sidebar.
  • webview view: deepseek-copilot.chatView.
  • tree view/drop zone: deepseek-copilot.dropZone.
  • commands: deepseek-copilot.openChat, deepseek-copilot.addSelectionToChat.

VS Code automatically generates activation events from those contributions. Do not keep a manual activationEvents list unless there is a specific reason.

activate(context)

src/Extension.ts should:

  • create VsCodeToolWorkspace.
  • inject it into core/tools.
  • create WebviewProvider.
  • register WebviewProvider.viewType.
  • create and register DropZoneProvider.
  • register commands.
  • add disposables to context.subscriptions.

deactivate()

It should clear the tool workspace host to avoid references to VS Code APIs after the extension closes.


Next page: Commands and Views

Clone this wiki locally