(scopeNumber: number, scope: IScope)
| 316 | } |
| 317 | |
| 318 | async _scopeVariable(scopeNumber: number, scope: IScope): Promise<Dap.Variable> { |
| 319 | const existing = scope.variables[scopeNumber]; |
| 320 | if (existing) { |
| 321 | return existing; |
| 322 | } |
| 323 | |
| 324 | const scopeRef: IScopeRef = { callFrameId: scope.callFrameId, scopeNumber }; |
| 325 | const extraProperties: IExtraProperty[] = []; |
| 326 | if (scopeNumber === 0) { |
| 327 | extraProperties.push({ name: 'this', value: scope.thisObject }); |
| 328 | if (scope.returnValue) |
| 329 | extraProperties.push({ |
| 330 | name: localize('scope.returnValue', 'Return value'), |
| 331 | value: scope.returnValue, |
| 332 | }); |
| 333 | } |
| 334 | |
| 335 | // eslint-disable-next-line |
| 336 | const variable = await this._thread |
| 337 | .pausedVariables()! |
| 338 | .createScope(scope.chain[scopeNumber].object, scopeRef, extraProperties); |
| 339 | return (scope.variables[scopeNumber] = variable); |
| 340 | } |
| 341 | |
| 342 | async completions(): Promise<Dap.CompletionItem[]> { |
| 343 | if (!this._scope) return []; |
no test coverage detected