MCPcopy Index your code
hub / github.com/WebFreak001/code-debug / evaluateRequest

Method evaluateRequest

src/mibase.ts:692–721  ·  view source on GitHub ↗
(response: DebugProtocol.EvaluateResponse, args: DebugProtocol.EvaluateArguments)

Source from the content-addressed store, hash-verified

690 }
691
692 protected evaluateRequest(response: DebugProtocol.EvaluateResponse, args: DebugProtocol.EvaluateArguments): void {
693 const [threadId, level] = this.frameIdToThreadAndLevel(args.frameId);
694 if (args.context == "watch" || args.context == "hover") {
695 this.miDebugger.evalExpression(args.expression, threadId, level).then((res) => {
696 response.body = {
697 variablesReference: 0,
698 result: res.result("value")
699 };
700 this.sendResponse(response);
701 }, msg => {
702 this.sendErrorResponse(response, 7, msg.toString());
703 });
704 } else {
705 this.miDebugger.sendUserInput(args.expression, threadId, level).then(output => {
706 if (typeof output == "undefined")
707 response.body = {
708 result: "",
709 variablesReference: 0
710 };
711 else
712 response.body = {
713 result: JSON.stringify(output),
714 variablesReference: 0
715 };
716 this.sendResponse(response);
717 }, msg => {
718 this.sendErrorResponse(response, 8, msg.toString());
719 });
720 }
721 }
722
723 protected gotoTargetsRequest(response: DebugProtocol.GotoTargetsResponse, args: DebugProtocol.GotoTargetsArguments): void {
724 const path: string = this.isSSH ? this.sourceFileMap.toRemotePath(args.source.path) : args.source.path;

Callers

nothing calls this directly

Calls 5

resultMethod · 0.80
toStringMethod · 0.80
sendUserInputMethod · 0.80
evalExpressionMethod · 0.65

Tested by

no test coverage detected