This document describes the debug launch configurations available for testing Linear Buddy during development.
Standard development mode - Runs the extension without any automatic actions.
{
"name": "Run Extension"
}Use this when:
- Testing normal extension behavior
- Debugging specific features manually
- You want full control over the extension
Auto-opens the walkthrough - Runs the extension and automatically opens the Getting Started walkthrough after 1 second.
{
"name": "Run Extension with Walkthrough",
"env": {
"LINEARBUDDY_OPEN_WALKTHROUGH": "true"
}
}Use this when:
- Testing the walkthrough tutorial
- Reviewing walkthrough content
- Debugging walkthrough-related issues
- Demonstrating features to team members
What happens:
- Extension activates normally
- After 1 second delay (to allow full activation)
- Walkthrough opens automatically
- You can navigate through all 11 steps
Auto-opens the help menu - Runs the extension and automatically opens the help menu picker.
{
"name": "Run Extension with Help Menu",
"env": {
"LINEARBUDDY_OPEN_HELP": "true"
}
}Use this when:
- Testing the help menu
- Reviewing help menu options
- Testing keyboard shortcuts display
- Testing FAQ functionality
What happens:
- Extension activates normally
- After 1 second delay
- Help menu quick pick opens
- You can select any help option
Standard test runner - Runs the extension test suite.
{
"name": "Extension Tests"
}-
Open Run and Debug panel
- Click the Run icon in the Activity Bar (or press
Cmd/Ctrl+Shift+D)
- Click the Run icon in the Activity Bar (or press
-
Select a configuration
- Use the dropdown at the top of the panel
- Choose one of the four configurations
-
Start debugging
- Click the green play button
- Or press
F5
- Press
Cmd/Ctrl+Shift+P - Type "Debug: Select and Start Debugging"
- Choose your preferred configuration
The debug configurations use environment variables to control behavior:
When set to "true", automatically opens the walkthrough after extension activation.
if (process.env.LINEARBUDDY_OPEN_WALKTHROUGH === "true") {
setTimeout(() => {
vscode.commands.executeCommand(
"workbench.action.openWalkthrough",
"personal.linear-buddy#linearBuddy.gettingStarted",
false
);
}, 1000);
}When set to "true", automatically opens the help menu after extension activation.
if (process.env.LINEARBUDDY_OPEN_HELP === "true") {
setTimeout(() => {
vscode.commands.executeCommand("linearBuddy.showHelp");
}, 1000);
}Both automatic actions use a 1-second delay (setTimeout(..., 1000)) to ensure:
- Extension is fully activated
- All commands are registered
- Tree views are initialized
- Context is ready
If you experience issues with timing, you can adjust this in src/extension.ts.
- Modify markdown files in
/media/walkthrough/ - Run
npm run compile(or rely on pre-launch task) - Select "Run Extension with Walkthrough"
- Press
F5 - Walkthrough opens automatically
- Navigate through steps to verify changes
- Modify help command in
src/extension.ts - Select "Run Extension with Help Menu"
- Press
F5 - Help menu opens automatically
- Test all menu options
- Select "Run Extension"
- Press
F5 - Manually trigger features via:
- Command Palette
- Sidebar buttons
- Right-click menus
- Chat commands
- Click in the gutter next to line numbers in TypeScript files
- Breakpoints work in
.tsfiles (source maps are configured) - Debug console shows all
console.logoutputs
- Use the Variables panel to inspect state
- Add expressions to the Watch panel
- Hover over variables in the editor
- Run commands:
vscode.commands.executeCommand(...) - Inspect objects:
context,vscode.window, etc. - Test APIs interactively
- Press
Cmd/Ctrl+Rin the Extension Development Host - Reloads the extension without restarting debugger
- Faster iteration for testing changes
All configurations include:
"preLaunchTask": "${defaultBuildTask}"This automatically runs npm run compile before launching, ensuring your latest code changes are compiled.
Debug configurations point to compiled JavaScript:
"outFiles": [
"${workspaceFolder}/out/**/*.js"
]Source maps enable debugging TypeScript directly.
- Check the Debug Console for errors
- Verify the walkthrough ID is correct in
package.json - Increase the timeout if extension is slow to activate
- Ensure the command is registered (check Debug Console)
- Verify no errors during activation
- Check that
linearBuddy.showHelpcommand exists
- Run
npm run compilemanually to check for errors - Check
package.jsonsyntax is valid - Verify all dependencies are installed (
npm install)
To add a new debug configuration:
- Open
.vscode/launch.json - Add a new configuration object
- Set environment variables as needed:
{
"name": "Your Config Name",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}",
"env": {
"YOUR_ENV_VAR": "value"
}
}- Add corresponding logic in
src/extension.ts:
if (process.env.YOUR_ENV_VAR === "value") {
// Your custom behavior
}✅ Faster Testing - No need to manually open walkthrough each time ✅ Consistent - Same starting point for every test run ✅ Efficient - Focus on testing, not setup ✅ Flexible - Multiple configurations for different scenarios ✅ Developer-Friendly - Easy to add new configurations
.vscode/launch.json- Launch configurationssrc/extension.ts- Environment variable checkspackage.json- Walkthrough definition/media/walkthrough/*.md- Walkthrough content
Happy debugging! 🐛🔍