Closed Abbyyan closed 3 years ago
Should i send a custom event from DA and receive on the vscode client using onDidReceiveDebugSessionCustomEvent
just like https://github.com/microsoft/vscode/issues/49389?
Find this https://github.com/microsoft/vscode/issues/40864 one. I've send an event in my DA like
// DebugAdapter.ts
const customEvent = { event: "customEvent", body: ["testsRoot"] } as DebugProtocol.Event;
this.sendEvent(customEvent);
and receive it on the vscode side
// extension.ts
export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(vscode.debug.onDidReceiveDebugSessionCustomEvent((e) => {
vscode.window.showInformationMessage('onDidReceiveDebugSessionCustomEvent!!!!!!' + e.event);
}));
}
And the log shows i've enter the customEvent
function in DA, but i can't see the info from vscode size. Could you please give me some suggestions if possible. Thanks a lot.
The issue https://github.com/microsoft/vscode/issues/71651#issuecomment-479949977 really helps me a lot. https://github.com/DanTup/vscode-repro-71651/commit/769928975ded0e74b3817bc96f8425226f0e7d22 shows a detailed usage of onDidReceiveDebugSessionCustomEvent
.
The reason of onDidReceiveDebugSessionCustomEvent
above is because i set the activationEvents
in package.json
only on commands and want to test it on Debug. Add onDebug
into activationEvents
, it works.
Thanks a lot.
open document
, i want to get the info on the vscode side and use vscode API to open a document. But how can i achieve this please? Read from BreakpointEvent, is there any method to define a custom event and custom the event on the vscode(client ) side please? If so , where should i define the vscode event please? Thanks a lot.