1 import * as path from "path";
2 import * as util from "util";
3 import * as vscode from "vscode";
6 LLDBDapDescriptorFactory,
8 } from "./debug-adapter-factory";
9 import { DisposableContext } from "./disposable-context";
12 * This class represents the extension and manages its life cycle. Other extensions
13 * using it as as library should use this class as the main entry point.
15 export class LLDBDapExtension extends DisposableContext {
18 this.pushSubscription(
19 vscode.debug.registerDebugAdapterDescriptorFactory(
21 new LLDBDapDescriptorFactory(),
25 this.pushSubscription(
26 vscode.workspace.onDidChangeConfiguration(async (event) => {
27 if (event.affectsConfiguration("lldb-dap.executable-path")) {
28 const dapPath = vscode.workspace
29 .getConfiguration("lldb-dap")
30 .get<string>("executable-path");
33 if (await isExecutable(dapPath)) {
37 LLDBDapDescriptorFactory.showLLDBDapNotFoundMessage(dapPath || "");
45 * This is the entry point when initialized by VS Code.
47 export function activate(context: vscode.ExtensionContext) {
48 context.subscriptions.push(new LLDBDapExtension());