Compare commits

...
Author SHA1 Message Date
Trevor Hudson 35bb3cdfea inline sources 2025-05-06 21:00:17 -07:00
Trevor Hudson 775c63672e dont wait 2025-05-06 20:50:28 -07:00
Trevor Hudson 6b5a4c0e4b introduce debugging to production extension 2025-05-06 20:12:42 -07:00
Trevor Hudson 339dd8a2aa add ability to debug production build 2025-05-06 18:26:13 -07:00
4 changed files with 54 additions and 1 deletions
+34
View File
@@ -184,6 +184,40 @@ To contribute to the project, start with our [Contributing Guide](CONTRIBUTING.m
</details>
<details>
<summary>Debugging the Production Build</summary>
If you are using Cline on other projects and you encounter an issue, you can launch a debugger to inspect the problem right away instead of switching to the Cline repo and launching the extension host.
1. Add the following to your USER settings.json:
```json
{
"launch": {
"version": "0.2.0",
"configurations": [
{
"trace": true,
"internalConsoleOptions": "openOnSessionStart",
"name": "Attach to Installed Extension",
"type": "node",
"request": "attach",
"address": "127.0.0.1",
"port": 9229,
"autoAttachChildProcesses": true,
"restart": true,
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true,
"outFiles": ["${env:HOME}/.cursor/extensions/saoudrizwan.claude-dev-*/dis/**/*.js"],
}
]
}
}
```
2. Run the `Cline: Open Debugger` command from the command palette.
3. Set a breakpoint in the Cline extension code and start debugging.
## License
+6 -1
View File
@@ -124,6 +124,11 @@
"title": "✨ Generate Commit Message with Cline",
"category": "Cline",
"icon": "$(robot)"
},
{
"command": "cline.openDebugger",
"title": "Open Debugger",
"category": "Cline"
}
],
"keybindings": [
@@ -432,4 +437,4 @@
"web-tree-sitter": "^0.22.6",
"zod": "^3.24.2"
}
}
}
+13
View File
@@ -14,6 +14,7 @@ import { Controller } from "./core/controller"
import { ErrorService } from "./services/error/ErrorService"
import { initializeTestMode, cleanupTestMode } from "./services/test/TestMode"
import { telemetryService } from "./services/posthog/telemetry/TelemetryService"
import * as inspector from "node:inspector"
/*
Built using https://github.com/microsoft/vscode-webview-ui-toolkit
@@ -444,6 +445,18 @@ export function activate(context: vscode.ExtensionContext) {
}),
)
context.subscriptions.push(
vscode.commands.registerCommand("cline.openDebugger", () => {
inspector.open(9229, "127.0.0.1")
const url = inspector.url()
if (!url) {
vscode.window.showErrorMessage("Failed to open inspector; URL is undefined")
return
}
vscode.window.showInformationMessage(`🛠️ Debugger listening at ${url}`)
}),
)
return createClineAPI(outputChannel, sidebarWebview.controller)
}
+1
View File
@@ -15,6 +15,7 @@
"rootDir": ".",
"skipLibCheck": true,
"sourceMap": true,
"inlineSources": true,
"strict": true,
"target": "es2022",
"useDefineForClassFields": true,