Skip to content

Commit

Permalink
Revert integer thing.
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron committed Nov 25, 2024
1 parent 6ce25ec commit 552d2c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/adapters/DebugProtocolAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ export class DebugProtocolAdapter {
* @param name the name of this variable. For example, `alpha.beta.charlie`, this value would be `charlie`. For local vars, this is the root variable name (i.e. `alpha`)
* @param parentEvaluateName the string used to derive the parent, _excluding_ this variable's name (i.e. `alpha.beta` or `alpha[0]`)
*/
private createEvaluateContainer(variable: Variable, name: string, parentEvaluateName: string) {
private createEvaluateContainer(variable: Variable, name: string | number, parentEvaluateName: string) {
let value;
let variableType = variable.type;
if (variable.value === null) {
Expand All @@ -660,15 +660,15 @@ export class DebugProtocolAdapter {
//build full evaluate name for this var. (i.e. `alpha["beta"]` + ["charlie"]` === `alpha["beta"]["charlie"]`)
let evaluateName: string;
if (!parentEvaluateName?.trim()) {
evaluateName = name;
evaluateName = name?.toString();
} else if (typeof name === 'string') {
evaluateName = `${parentEvaluateName}["${name}"]`;
} else if (typeof name === 'number') {
evaluateName = `${parentEvaluateName}[${name}]`;
}

let container: EvaluateContainer = {
name: name ?? '',
name: name?.toString() ?? '',
evaluateName: evaluateName ?? '',
type: variableType ?? '',
value: value ?? null,
Expand All @@ -687,7 +687,7 @@ export class DebugProtocolAdapter {
const childVariable = variable.children[i];
const childContainer = this.createEvaluateContainer(
childVariable,
container.keyType === KeyType.integer ? i?.toString() : childVariable.name,
container.keyType === KeyType.integer ? i : childVariable.name,
container.evaluateName
);
container.children.push(childContainer);
Expand Down

0 comments on commit 552d2c3

Please sign in to comment.