diff --git a/src/lrdbDebug.ts b/src/lrdbDebug.ts index 86ee61ec..ce22daf1 100644 --- a/src/lrdbDebug.ts +++ b/src/lrdbDebug.ts @@ -511,7 +511,7 @@ export class LuaDebugSession extends DebugSession { variablesData.forEach((v,i) => { const typename = typeof v const k = i + 1 - const varRef = (typename == 'object') ? this._variableHandles.create(evalParam(k)) : undefined + const varRef = (typename == 'object') ? this._variableHandles.create(evalParam(k)) : 0 variables.push({ name: `${k}`, type: typename, @@ -522,7 +522,7 @@ export class LuaDebugSession extends DebugSession { } else if (typeof variablesData === 'object') { for (const k in variablesData) { const typename = typeof variablesData[k] - const varRef = (typename == 'object') ? this._variableHandles.create(evalParam(k)) : undefined + const varRef = (typename == 'object') ? this._variableHandles.create(evalParam(k)) : 0 variables.push({ name: k, type: typename, diff --git a/test/__snapshots__/debugadapter.test.ts.snap b/test/__snapshots__/debugadapter.test.ts.snap index e7d96f8d..05a1a7bd 100644 --- a/test/__snapshots__/debugadapter.test.ts.snap +++ b/test/__snapshots__/debugadapter.test.ts.snap @@ -8,16 +8,19 @@ Object { "name": "local_value1", "type": "number", "value": "1", + "variablesReference": 0, }, Object { "name": "local_value2", "type": "string", "value": "\\"abc\\"", + "variablesReference": 0, }, Object { "name": "local_value3", "type": "number", "value": "1", + "variablesReference": 0, }, Object { "name": "local_value4", @@ -40,5 +43,6 @@ Object { "name": "a", "type": "number", "value": "1", + "variablesReference": 0, } `; diff --git a/test/debugadapter.test.ts b/test/debugadapter.test.ts index 84903314..e07a39de 100644 --- a/test/debugadapter.test.ts +++ b/test/debugadapter.test.ts @@ -283,6 +283,7 @@ describe('Lua Debug Adapter', () => { name: '_VERSION', type: 'string', value: '"Lua 5.3"', + variablesReference: 0 }) )) })