Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Implementing support to supportsSetSymbolOptions #1467

Merged
merged 10 commits into from
Dec 27, 2022
15 changes: 12 additions & 3 deletions src/adapter/debugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export class DebugAdapter implements IDisposable {
this.dap.on('setSourceMapStepping', params => this._setSourceMapStepping(params));
this.dap.on('stepInTargets', params => this._stepInTargets(params));
this.dap.on('setDebuggerProperty', params => this._setDebuggerProperty(params));
this.dap.on('setSymbolOptions', params => this._setSymbolOptions(params));
}

private _setDebuggerProperty(
Expand All @@ -127,6 +128,13 @@ export class DebugAdapter implements IDisposable {
return Promise.resolve({});
}

private _setSymbolOptions(
params: Dap.SetSymbolOptionsParams,
): Promise<Dap.SetSymbolOptionsResult> {
this._thread?.cdp().DotnetDebugger.setSymbolOptions(params);
return Promise.resolve({});
}

private _breakpointLocations(
params: Dap.BreakpointLocationsParams,
): Promise<Dap.BreakpointLocationsResult> {
Expand Down Expand Up @@ -193,13 +201,13 @@ export class DebugAdapter implements IDisposable {
async _onInitialize(params: Dap.InitializeParams): Promise<Dap.InitializeResult | Dap.Error> {
console.assert(params.linesStartAt1);
console.assert(params.columnsStartAt1);
const capabilities = DebugAdapter.capabilities();
const capabilities = DebugAdapter.capabilities(true);
setTimeout(() => this.dap.initialized({}), 0);
setTimeout(() => this._thread?.dapInitialized(), 0);
return capabilities;
}

static capabilities(): Dap.CapabilitiesExtended {
static capabilities(extended = false): Dap.CapabilitiesExtended {
return {
supportsConfigurationDoneRequest: true,
supportsFunctionBreakpoints: false,
Expand Down Expand Up @@ -256,7 +264,8 @@ export class DebugAdapter implements IDisposable {
supportsBreakpointLocationsRequest: true,
supportsClipboardContext: true,
supportsExceptionFilterOptions: true,
supportsDebuggerProperties: true,
supportsDebuggerProperties: extended ? true : false,
supportsSetSymbolOptions: extended ? true : false,
//supportsDataBreakpoints: false,
//supportsDisassembleRequest: false,
};
Expand Down
12 changes: 12 additions & 0 deletions src/build/dapCustom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,22 @@ const dapCustom: JSONSchema4 = {
supportsDebuggerProperties: {
type: 'boolean',
},
supportsSetSymbolOptions: {
type: 'boolean',
description: 'The debug adapter supports the set symbol options request',
},
},
},
],
},

...makeRequest('setSymbolOptions', 'Sets options for locating symbols.'),

SetSymbolOptionsArguments: {
type: 'object',
description:
'Arguments for "setSymbolOptions" request. Properties are determined by debugger.',
},
},
};

Expand Down
10 changes: 10 additions & 0 deletions src/build/wasmCustom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export default {
description:
'Arguments for "setDebuggerProperty" request. Properties are determined by debugger.',
},
{
id: 'SetSymbolOptionsParams',
type: 'object',
description:
'Arguments for "setSymbolOptions" request. Properties are determined by debugger.',
},
],
commands: [
{
Expand All @@ -30,6 +36,10 @@ export default {
},
],
},
{
name: 'setSymbolOptions',
description: 'Sets options for locating symbols.',
},
],
},
],
Expand Down
Loading