MCPcopy
hub / github.com/microsoft/vscode-js-debug / evaluateAndLog

Method evaluateAndLog

src/test/logger.ts:222–248  ·  view source on GitHub ↗
(
    expressions: string[] | string,
    options: ILogOptions = {},
    context?: 'watch' | 'repl' | 'hover' | 'clipboard',
  )

Source from the content-addressed store, hash-verified

220 context?: 'watch' | 'repl' | 'hover' | 'clipboard',
221 ): Promise<void>;
222 async evaluateAndLog(
223 expressions: string[] | string,
224 options: ILogOptions = {},
225 context?: 'watch' | 'repl' | 'hover' | 'clipboard',
226 ): Promise<Dap.Variable | void> {
227 if (typeof expressions === 'string') {
228 const result = await this._dap.evaluate({
229 expression: expressions,
230 context,
231 ...options.params,
232 format: options.format,
233 });
234 if (typeof result === 'string') {
235 this._log(`<error>: ${result}`);
236 return { name: 'result', value: result, variablesReference: 0 };
237 }
238 return await this.logEvaluateResult(result, options);
239 }
240
241 for (const expression of expressions) {
242 this._log(`Evaluating: '${expression}'`);
243 const evaluation = this._dap.evaluate({ expression, context });
244 await this.logOutput(await this._dap.once('output'), options);
245 await evaluation;
246 this._log(``);
247 }
248 }
249}

Callers 10

wasm.test.tsFile · 0.80
waitForPauseAndLogIFunction · 0.80
consoleAPITest.tsFile · 0.80
variablesTest.tsFile · 0.80
evaluate.tsFile · 0.80
evaluateAtReturnFunction · 0.80
evaluateFunction · 0.80

Calls 4

logEvaluateResultMethod · 0.95
logOutputMethod · 0.95
evaluateMethod · 0.65
onceMethod · 0.65

Tested by 1

evaluateFunction · 0.64