MCPcopy Create free account
hub / github.com/WebFreak001/code-debug / setVariableRequest

Method setVariableRequest

src/mibase.ts:183–208  ·  view source on GitHub ↗
(response: DebugProtocol.SetVariableResponse, args: DebugProtocol.SetVariableArguments)

Source from the content-addressed store, hash-verified

181 }
182
183 protected async setVariableRequest(response: DebugProtocol.SetVariableResponse, args: DebugProtocol.SetVariableArguments): Promise<void> {
184 try {
185 if (this.useVarObjects) {
186 let name = args.name;
187 const parent = this.variableHandles.get(args.variablesReference);
188 if (parent instanceof VariableScope) {
189 name = VariableScope.variableName(args.variablesReference, name);
190 } else if (parent instanceof VariableObject) {
191 name = `${parent.name}.${name}`;
192 }
193
194 const res = await this.miDebugger.varAssign(name, args.value);
195 response.body = {
196 value: res.result("value")
197 };
198 } else {
199 await this.miDebugger.changeVariable(args.name, args.value);
200 response.body = {
201 value: args.value
202 };
203 }
204 this.sendResponse(response);
205 } catch (err) {
206 this.sendErrorResponse(response, 11, `Could not continue: ${err}`);
207 }
208 }
209
210 protected setFunctionBreakPointsRequest(response: DebugProtocol.SetFunctionBreakpointsResponse, args: DebugProtocol.SetFunctionBreakpointsArguments): void {
211 const all = [];

Callers

nothing calls this directly

Calls 4

variableNameMethod · 0.80
varAssignMethod · 0.80
resultMethod · 0.80
changeVariableMethod · 0.65

Tested by

no test coverage detected