Browse Source

Merge pull request #405 from vincentsong/feature/vscode-debug

feat: Added VS Code debugging support with webview build and changed output channel from 'Cline' to 'Roo-Cline'
Matt Rubens 1 year ago
parent
commit
431ff57435
4 changed files with 39 additions and 7 deletions
  1. 5 0
      .changeset/plenty-suits-visit.md
  2. 15 3
      .vscode/launch.json
  3. 16 1
      .vscode/tasks.json
  4. 3 3
      src/extension.ts

+ 5 - 0
.changeset/plenty-suits-visit.md

@@ -0,0 +1,5 @@
+---
+"roo-cline": patch
+---
+
+debug from vscode and changed output channel to Roo-Cline

+ 15 - 3
.vscode/launch.json

@@ -9,9 +9,21 @@
 			"name": "Run Extension",
 			"type": "extensionHost",
 			"request": "launch",
-			"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
+			"runtimeExecutable": "${execPath}",
+			"args": [
+				"--extensionDevelopmentPath=${workspaceFolder}",
+			],
+			"sourceMaps": true,
 			"outFiles": ["${workspaceFolder}/dist/**/*.js"],
-			"preLaunchTask": "${defaultBuildTask}"
-		}
+			"preLaunchTask": "compile",
+			"env": {
+				"NODE_ENV": "development",
+				"VSCODE_DEBUG_MODE": "true"
+			},
+			"resolveSourceMapLocations": [
+				"${workspaceFolder}/**",
+				"!**/node_modules/**"
+			]
+		},
 	]
 }

+ 16 - 1
.vscode/tasks.json

@@ -3,6 +3,21 @@
 {
 	"version": "2.0.0",
 	"tasks": [
+		{
+			"label": "compile",
+			"type": "npm",
+			"script": "compile",
+			"dependsOn": ["npm: build:webview"],
+			"group": {
+				"kind": "build",
+				"isDefault": true
+			},
+			"presentation": {
+				"reveal": "silent",
+				"panel": "shared"
+			},
+			"problemMatcher": ["$tsc", "$eslint-stylish"]
+		},
 		{
 			"label": "watch",
 			"dependsOn": ["npm: build:webview", "npm: watch:tsc", "npm: watch:esbuild"],
@@ -11,7 +26,7 @@
 			},
 			"group": {
 				"kind": "build",
-				"isDefault": true
+				"isDefault": false
 			}
 		},
 		{

+ 3 - 3
src/extension.ts

@@ -21,10 +21,10 @@ let outputChannel: vscode.OutputChannel
 // This method is called when your extension is activated
 // Your extension is activated the very first time the command is executed
 export function activate(context: vscode.ExtensionContext) {
-	outputChannel = vscode.window.createOutputChannel("Cline")
+	outputChannel = vscode.window.createOutputChannel("Roo-Cline")
 	context.subscriptions.push(outputChannel)
 
-	outputChannel.appendLine("Cline extension activated")
+	outputChannel.appendLine("Roo-Cline extension activated")
 
 	// Get default commands from configuration
 	const defaultCommands = vscode.workspace.getConfiguration("roo-cline").get<string[]>("allowedCommands") || []
@@ -163,5 +163,5 @@ export function activate(context: vscode.ExtensionContext) {
 
 // This method is called when your extension is deactivated
 export function deactivate() {
-	outputChannel.appendLine("Cline extension deactivated")
+	outputChannel.appendLine("Roo-Cline extension deactivated")
 }