MCPcopy Create free account
hub / github.com/Snapchat/Valdi / activate

Function activate

valdi/vscode_debugger/src/extension.ts:30–102  ·  view source on GitHub ↗
(context: vscode.ExtensionContext)

Source from the content-addressed store, hash-verified

28import { registerRevealPage } from './ui/revealPage';
29
30export function activate(context: vscode.ExtensionContext) {
31 const services = createGlobalContainer({
32 // On Windows, use the os.tmpdir() since the extension storage path is too long. See:
33 // https://github.com/microsoft/vscode-js-debug/issues/342
34 storagePath:
35 process.platform === 'win32' ? tmpdir() : context.storagePath || context.extensionPath,
36 isVsCode: true,
37 isRemote:
38 !!process.env.JS_DEBUG_USE_COMPANION ||
39 vscode.extensions.getExtension(extensionId)?.extensionKind === vscode.ExtensionKind.Workspace,
40 context,
41 });
42
43 context.subscriptions.push(
44 registerCommand(vscode.commands, Commands.DebugNpmScript, debugNpmScript),
45 registerCommand(vscode.commands, Commands.PickProcess, pickProcess),
46 registerCommand(vscode.commands, Commands.AttachProcess, attachProcess),
47 registerCommand(vscode.commands, Commands.ToggleSkipping, toggleSkippingFile),
48 registerCommand(vscode.commands, Commands.EnlistExperiment, toggleOnExperiment),
49 );
50
51 context.subscriptions.push(
52 ...services
53 .getAll<IDebugConfigurationResolver>(IDebugConfigurationResolver)
54 .map(provider =>
55 vscode.debug.registerDebugConfigurationProvider(
56 provider.type,
57 provider as vscode.DebugConfigurationProvider,
58 ),
59 ),
60
61 ...services
62 .getAll<IDebugConfigurationProvider>(IDebugConfigurationProvider)
63 .map(provider =>
64 vscode.debug.registerDebugConfigurationProvider(
65 provider.type,
66 provider as vscode.DebugConfigurationProvider,
67 vscode.DebugConfigurationProviderTriggerKind !== undefined
68 ? provider.triggerKind
69 : undefined,
70 ),
71 ),
72 );
73
74 const sessionManager = new VSCodeSessionManager(services);
75 const debugTypesToRegister = [...allDebugTypes].filter((type) => shouldRegisterDebugAdapterDescriptorFactory(type))
76 context.subscriptions.push(
77 ...[...debugTypesToRegister].map(type =>
78 vscode.debug.registerDebugAdapterDescriptorFactory(type, sessionManager)
79 ),
80 );
81 context.subscriptions.push(
82 vscode.debug.onDidTerminateDebugSession(s => sessionManager.terminate(s)),
83 );
84 context.subscriptions.push(sessionManager);
85
86 const debugSessionTracker = services.get(DebugSessionTracker);
87 debugSessionTracker.attach();

Callers

nothing calls this directly

Calls 15

terminateMethod · 0.95
createGlobalContainerFunction · 0.90
registerCommandFunction · 0.90
registerLongBreakpointUIFunction · 0.90
registerDebugTerminalUIFunction · 0.90
registerNpmScriptLensFunction · 0.90
registerProfilingCommandFunction · 0.90
registerAutoAttachFunction · 0.90
registerRevealPageFunction · 0.90

Tested by

no test coverage detected