extension.ts 814 B

12345678910111213141516171819
  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(vscode.debug.registerDebugAdapterDescriptorFactory(
  6. 'ecaldebug', new InlineDebugAdapterFactory()))
  7. }
  8. export function deactivate () {
  9. }
  10. class InlineDebugAdapterFactory implements vscode.DebugAdapterDescriptorFactory {
  11. createDebugAdapterDescriptor (_session: vscode.DebugSession): ProviderResult<vscode.DebugAdapterDescriptor> {
  12. // Declare the ECALDebugSession as an DebugAdapterInlineImplementation so extention and adapter can
  13. // run in-process (making it possible to easily debug the adapter)
  14. return new vscode.DebugAdapterInlineImplementation(new ECALDebugSession())
  15. }
  16. }