MCPcopy Create free account
hub / github.com/Snapchat/Valdi / _scopeVariable

Method _scopeVariable

valdi/vscode_debugger/src/adapter/stackTrace.ts:318–340  ·  view source on GitHub ↗
(scopeNumber: number, scope: IScope)

Source from the content-addressed store, hash-verified

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 [];

Callers 2

scopesMethod · 0.95
completionsMethod · 0.95

Calls 3

createScopeMethod · 0.80
pausedVariablesMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected