extension.ts 846 B

12345678910111213141516171819202122232425
  1. import * as vscode from "vscode";
  2. import { ProviderResult } from "vscode";
  3. import { ECALDebugSession } from "./ecalDebugAdapter";
  4. export function activate(context: vscode.ExtensionContext) {
  5. context.subscriptions.push(
  6. vscode.debug.registerDebugAdapterDescriptorFactory(
  7. "ecaldebug",
  8. new InlineDebugAdapterFactory()
  9. )
  10. );
  11. }
  12. export function deactivate() {}
  13. class InlineDebugAdapterFactory
  14. implements vscode.DebugAdapterDescriptorFactory {
  15. createDebugAdapterDescriptor(
  16. _session: vscode.DebugSession
  17. ): ProviderResult<vscode.DebugAdapterDescriptor> {
  18. // Declare the ECALDebugSession as an DebugAdapterInlineImplementation so extension and adapter can
  19. // run in-process (making it possible to easily debug the adapter)
  20. return new vscode.DebugAdapterInlineImplementation(new ECALDebugSession());
  21. }
  22. }