You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`WaitForBreakpointTool` - Waits for breakpoint hits using Debug Adapter Protocol monitoring
36
35
-`GetVariablesTool` - Retrieves all variables from active debug sessions using DAP
37
36
-`ExpandVariableTool` - Expands specific variables to show detailed contents and immediate children
38
37
-**Tool registration**: Registers tools with VS Code's language model system via `vscode.lm.registerTool()`
@@ -50,7 +49,6 @@ This is a VS Code extension that integrates with GitHub Copilot to provide debug
50
49
51
50
-`src/extension.ts` - Main extension logic, activation, and tool registration only
52
51
-`src/startDebuggerTool.ts` - StartDebuggerTool class and interface
53
-
-`src/waitForBreakpointTool.ts` - WaitForBreakpointTool class and interface (requires debug-tracker-vscode)
54
52
-`src/debugUtils.ts` - Shared DAP interfaces, types, and DAPHelpers utility class
55
53
-`src/getVariablesTool.ts` - GetVariablesTool class and interface
56
54
-`src/expandVariableTool.ts` - ExpandVariableTool class and interface
@@ -61,19 +59,11 @@ This is a VS Code extension that integrates with GitHub Copilot to provide debug
61
59
62
60
## Extension Configuration
63
61
64
-
The extension contributes language model tools that allow Copilot to interact with VS Code's debugging system:
65
-
66
-
-**`set_breakpoint`** - Sets breakpoints by specifying file path and line number
67
-
-**`start_debugger`** - Starts debugging sessions with optional configuration name
68
-
-**`wait_for_breakpoint`** - Waits for the debugger to hit a breakpoint or stop execution
69
-
-**`get_variables`** - Retrieves all variables from the current debug session when stopped
70
-
-**`expand_variable`** - Expands a specific variable to show its detailed contents and immediate child properties
71
-
72
-
Tools are automatically available to Copilot when the extension is active.
62
+
The extension contributes language model tools that allow Copilot to interact with VS Code's debugging system. Tools are automatically available when the extension is active.
73
63
74
64
### Breakpoint Features
75
65
76
-
All breakpoint-related tools (`start_debugger` and `resume_debug_session`) support advanced breakpoint configurations:
66
+
All breakpoint-related tools (`startDebugSessionWithBreakpoints` and `resumeDebugSession`) support advanced breakpoint configurations:
77
67
78
68
-**Conditional Breakpoints**: Set `condition` to specify an expression that must evaluate to true for the breakpoint to trigger
@@ -88,7 +78,7 @@ All three properties are optional and can be combined with basic breakpoints tha
88
78
89
79
### Workspace Folder Semantics
90
80
91
-
`start_debugger` requires a `workspaceFolder` parameter that must be an absolute path exactly matching one of the open workspace folder roots (`workspace.workspaceFolders[].uri.fsPath`).
81
+
`startDebugSessionWithBreakpoints` requires a `workspaceFolder` parameter that must be an absolute path exactly matching one of the open workspace folder roots (`workspace.workspaceFolders[].uri.fsPath`).
92
82
93
83
Simplifications implemented:
94
84
@@ -119,16 +109,6 @@ Example workspace setting:
119
109
120
110
You can simulate startup delay via a `preLaunchTask` (e.g. `sleep-build-delay`) in `launch.json`. The test suite uses this with `Run timeoutTest.js` to validate timeout behavior.
121
111
122
-
## Prerequisites
123
-
124
-
This extension requires the **debug-tracker-vscode** extension to be installed for the `wait_for_breakpoint` tool to function:
125
-
126
-
1.**Automatic Installation**: The extension will attempt to auto-install if not present
127
-
2.**Manual Installation**: Install from VS Code marketplace: `mcu-debug.debug-tracker-vscode`
128
-
3.**Command**: Use Quick Open (`Ctrl+P`) and search for "debug-tracker-vscode"
129
-
130
-
The debug tracker extension provides API services for monitoring debug sessions and is required for breakpoint waiting functionality.
131
-
132
112
## Implementation Notes
133
113
134
114
- When adding new tools, define the interface in `package.json` under `languageModelTools`
@@ -198,7 +178,7 @@ The debug tracker extension provides API services for monitoring debug sessions
198
178
199
179
### Promise-based Tool Implementation
200
180
201
-
- For tools that wait for events (like `wait_for_breakpoint`), return a Promise from `invoke()`
181
+
- For tools that wait for events, return a Promise from `invoke()`
202
182
- Use proper Promise constructor with resolve/reject for event-driven operations
203
183
- Implement cleanup logic in both success and error paths
204
184
- Handle race conditions between timeouts and actual events
"userDescription": "Start a debug session, set breakpoints, and wait until a breakpoint is hit. Supports onHit behaviors: break (pause & return), captureAndContinue (collect variables & interpolated log messages then resume automatically), stopDebugging (terminate after hit). Supports serverReady.action types: httpRequest | shellCommand | vscodeCommand (auto-run after readiness trigger). Exact numeric hitCount pauses on that occurrence.",
126
127
"modelDescription": "Start a debug session using the configured default launch configuration or an explicitly provided configurationName. Auto-selects sole launch config when none specified and no default setting is present. Each breakpoint can specify an onHit: break (pause), captureAndContinue (non-blocking gather of variables & interpolation of {var} placeholders in logMessage then continue), or stopDebugging (terminate immediately after hit). Supports serverReady with trigger {path+line | pattern | omitted attach} and action.type httpRequest | shellCommand | vscodeCommand. Conditional expressions and exact numeric hitCount only. variableFilter required only for captureAndContinue; omit to capture all locals up to captureMaxVariables.",
@@ -327,11 +328,10 @@
327
328
]
328
329
}
329
330
},
330
-
{
331
-
"name": "resume_debug_session",
331
+
{
332
+
"name": "resumeDebugSession",
332
333
"displayName": "Resume Debug Session",
333
334
"toolReferenceName": "resumeDebugSession",
334
-
"when": "debugState == 'running'",
335
335
"canBeReferencedInPrompt": true,
336
336
"userDescription": "Resume a paused debug session optionally waiting for the next breakpoint. Supports actions (break, capture, stopDebugging) and numeric hitCount shorthand when adding new breakpoints during resume.",
337
337
"modelDescription": "Resume execution of the specified debug session. Optionally wait for next stop and set/clear breakpoints before continuing. Each new breakpoint may specify action (break | capture | stopDebugging), conditional expressions, exact numeric hitCount, and logMessage interpolation for capture.",
return"Debugger State: terminated. Recommended tool: start_debugger_with_breakpoints to begin a new session.";
242
+
return"Debugger State: terminated. Recommended tool: startDebugSessionWithBreakpoints to begin a new session.";
227
243
case"running":
228
-
return`Debugger State: running. (onHit 'captureAndContinue' continued session '${sessionLabel}'). Recommended tools: wait_for_breakpoint or resume_debug_session with new breakpoints.`;
244
+
return`Debugger State: running. (onHit 'captureAndContinue' continued session '${sessionLabel}'). Recommended tool: resumeDebugSession with new breakpoints.`;
229
245
}
230
246
})();
231
247
@@ -256,6 +272,12 @@ export class StartDebuggerTool
256
272
);
257
273
}
258
274
275
+
if(truncatedVariables){
276
+
guidance.push(
277
+
"Tip: Values were truncated to 100 characters. Provide variableFilter to return full values without truncation."
0 commit comments