From 8f753846b11d8b97cc24d50987da02ecb72c46cf Mon Sep 17 00:00:00 2001 From: commandblock2 Date: Fri, 1 Mar 2024 22:29:18 +0800 Subject: [PATCH] use parameter for callstack retrieving --- core/context/providers/LocalsProvider.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/context/providers/LocalsProvider.ts b/core/context/providers/LocalsProvider.ts index 63add03b2..c01ebbd33 100644 --- a/core/context/providers/LocalsProvider.ts +++ b/core/context/providers/LocalsProvider.ts @@ -23,16 +23,19 @@ class LocalsProvider extends BaseContextProvider { const localVariables = await extras.ide.getDebugLocals(Number(query)); const callStacksSources = await extras.ide.getTopLevelCallStackSources( Number(query), - 3 + this.options?.stackDepth || 3 ); const callStackContents = callStacksSources.reduce( (acc, source, index) => - acc + `\n\ncall stack ${index}\n` + "```\n" + source + "\n```", "" + acc + `\n\ncall stack ${index}\n` + "```\n" + source + "\n```", + "" ); return [ { description: "The value, name and possibly type of the local variables", - content: `Current local variable contents:\n\n${localVariables}.\n\n Current top level call stacks: \n\n ${callStackContents}`, + content: + `Current local variable contents:\n\n${localVariables}.\n` + + `Current top level call stacks: \n\n${callStackContents}`, name: "Locals", }, ];