Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Go launch.json and CONTRIB docs #2446

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ node_modules
# Visual Studio Code
.vscode/*
!.vscode/recommended.settings.json
!.vscode/launch.json
!.vscode/tasks.json
!.vscode/extensions.json
!.vscode/*.code-snippets
Expand Down
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch API",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/publisher/main.go",
"args": ["ui", "--listen=localhost:9001", "-vv"],
"cwd": "${workspaceFolder}"
}
]
}
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- [Build Tools](#build-tools)
- [Environment Variables](#environment-variables)
- [Behavior in GitHub Actions](#behavior-in-github-actions)
- [Debugging in VS Code](#debugging-in-vs-code)
- [Extension Development](#extension-development)
- [Release](#release)
- [Instructions](#instructions)
Expand Down Expand Up @@ -111,6 +112,20 @@ This mode can be reproduced on your local machine by setting `CI=true`.
| -------- | ------- |
| MODE | prod |

### Debugging in VS Code

A `launch.json` can be found at the root in the `.vscode` directory for
debugging the Go API code.

The "Launch API" configuration will start the API at port 9001.
To change the directory that the API is started in, update the `cwd` property
to the directory you want the API to be launched at.

When debugging alongside the
[VS Code Extension](./extensions/vscode/CONTRIBUTING.md#debugging) the `cwd`
will frequently be the workspace folder of the extension host development
window.

### Extension Development

See [the Contribution Guide for the VSCode Extension](./extensions/vscode/CONTRIBUTING.md).
Expand Down
6 changes: 6 additions & 0 deletions extensions/vscode/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ Either invocation will launch a new window named `Extension Host Development` wi

When testing, utilize the sample projects in `../../test/sample-content`. Open these projects as a workspace within the `Extension Host Development` window.

#### Connecting to API Debug Session

To connect to the API debug session change the `Service` class in
`extensions/vscode/src/services.ts` to a hardcoded `port = 9001;` and remove
the code inside of the `start` and `stop` methods.

### Re-building the Webview(s)

The built-in debugger watches for extension changes, but not changes for our
Expand Down