Skip to content

Commit bcaad03

Browse files
committed
context.id of 2 is Class, and fallback on ids>2
1 parent 1101ca2 commit bcaad03

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/debug/debugSession.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
8282

8383
private _contexts = new Map<number, xdebug.Context>();
8484

85-
private _contextNames: string[] = ["Private", "Public"];
85+
private _contextNames: string[] = ["Private", "Public", "Class"];
8686

8787
private _properties = new Map<number, xdebug.Property>();
8888

@@ -389,7 +389,11 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
389389
scopes = contexts.map((context) => {
390390
const variableId = this._variableIdCounter++;
391391
this._contexts.set(variableId, context);
392-
return new Scope(this._contextNames[context.id], variableId);
392+
if (context.id < this._contextNames.length) {
393+
return new Scope(this._contextNames[context.id], variableId);
394+
} else {
395+
return new Scope(context.name, variableId);
396+
}
393397
});
394398
response.body = {
395399
scopes,

0 commit comments

Comments
 (0)