Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
fix: Fix debug debugger tasks and guide
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdor committed Oct 20, 2018
1 parent 8873ab5 commit 7afe072
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 32 deletions.
30 changes: 9 additions & 21 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
{
"version": "0.1.0",
"version": "0.2.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
// path to VSCode executable
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm"
},
{
"name": "Launch as server",
"type": "node2",
"type": "node",
"protocol": "inspector",
"request": "launch",
"program": "${workspaceFolder}/out/src/debugAdapter/goDebug.js",
"args": [
"--server=4712"
],
"args": ["--server=4711"],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
]
"outFiles": ["${workspaceFolder}/out/**/*.js"]
},
{
"name": "Launch Tests",
Expand All @@ -42,9 +35,7 @@
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm"
},
{
Expand All @@ -66,10 +57,7 @@
"compounds": [
{
"name": "Extension + Debug server",
"configurations": [
"Launch Extension",
"Launch as server"
]
"configurations": ["Launch Extension", "Launch as server"]
}
]
}
8 changes: 5 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@
// A task runner that calls the Typescript compiler (tsc) and
// compiles the extension.
{
"version": "0.1.0",
"version": "2.0.0",

// we want to run npm
"command": "npm",

// the command is a shell script
"isShellCommand": true,
"type": "shell",

// show the output window only if unrecognized errors occur.
"showOutput": "silent",
"presentation": {
"reveal": "silent"
},

// we run the custom script "compile" as defined in package.json
"args": ["run", "compile"],
Expand Down
6 changes: 3 additions & 3 deletions src/debugAdapter/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"request": "launch",
"program": "${workspaceRoot}/../../out/src/debugAdapter/goDebug.js",
"stopOnEntry": false,
"args": [ "--server=4711" ],
"args": ["--server=4711"],
"sourceMaps": true,
"outDir": "${workspaceRoot}/../../out/src/debugAdapter"
"outFiles": ["${workspaceRoot}/../../out/src/debugAdapter"]

This comment has been minimized.

Copy link
@alexdor

alexdor Oct 20, 2018

Author Contributor

@ramya-rao-a should I turn this to workspaceFolder as well?

This comment has been minimized.

Copy link
@ramya-rao-a

ramya-rao-a Oct 20, 2018

Contributor

Yes. I have pushed a commit to do the same.

}
]
}
}
12 changes: 7 additions & 5 deletions src/debugAdapter/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ This code runs in a seperate Node process spawned by Code when launch the 'go' t

The ideal setup involves three instances of Code:

1. Clone this [repo](https://github.com/Microsoft/vscode-go) and then run `npm install`
1. Clone this [repo](https://github.com/Microsoft/vscode-go) and then run `npm install`

```
git clone https://github.com/Microsoft/vscode-go
cd vscode-go
npm install
```
2. Open the `vscode-go` folder in one instance. Choose the `Launch Extension` debug target and hit F5 to launch a second instance.
3. In the second instance, open the Go application you'd like to test against. In that instance, create a new Go debug target pointing at the program you want to debug, and add `"debugServer": 4711` in the root of the configuration.
4. Open another instance of Code on the `vscode-go/src/debugAdapter` folder. In that instance hit F5 to launch the debug adapter in server mode under the debugger.
5. Go back to the second instance and hit F5 to debug your Go code. Debuggers from the other two Code windows are attached to the Go debug adapter and the Go language integation respectively, so you can set breakpoints, step through code and inspect state as needed.

2. Open the `vscode-go` folder in one instance. Choose the `Launch Extension` debug target and hit F5 to launch a second instance.
3. In the second instance, open the Go application you'd like to test against. In that instance, create a new Go debug target pointing at the program you want to debug, and add `"debugServer": 4711` in the root of the configuration.
4. Open another instance of Code on the `vscode-go/src/debugAdapter` folder. In that instance hit F5 to launch the debug adapter in server mode under the debugger.
5. Go back to the second instance and hit F5 to debug your Go code. Debuggers from the other two Code windows are attached to the Go debug adapter and the Go language integation respectively, so you can set breakpoints, step through code and inspect state as needed.

0 comments on commit 7afe072

Please sign in to comment.