Skip to content

Commit 6d85977

Browse files
authored
Add --update arg to init-launch-sandbox (#1760)
## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [ ] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [ ] I have not broken the cheatsheet
1 parent a7613de commit 6d85977

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docs/contributing/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extension](#running--testing-extension-locally). You may also find the [VSCode A
3737
pnpm init-vscode-sandbox
3838
```
3939

40-
The `pnpm init-vscode-sandbox` command creates a local [VSCode settings profile](https://code.visualstudio.com/updates/v1_72#_settings-profiles) that acts as a sandbox containing a specific set of VSCode extensions that will be run alongside Cursorless when you launch Cursorless in debug or test mode. This approach is [suggested](https://code.visualstudio.com/updates/v1_72#_extension-debugging-in-a-clean-environment) by the VSCode documentation. If you'd like to use additional extensions when debugging locally, you can use the following command:
40+
The `pnpm init-vscode-sandbox` command creates a local [VSCode settings profile](https://code.visualstudio.com/updates/v1_72#_settings-profiles) that acts as a sandbox containing a specific set of VSCode extensions that will be run alongside Cursorless when you launch Cursorless in debug or test mode. This approach is [suggested](https://code.visualstudio.com/updates/v1_72#_extension-debugging-in-a-clean-environment) by the VSCode documentation. If you need to update any of the extension dependencies in the sandbox, you can add `--force` to the command. If you'd like to use additional extensions when debugging locally, you can use the following command:
4141

4242
```bash
4343
code --profile=cursorlessDevelopment --install-extension some.extension

packages/cursorless-vscode/src/scripts/initLaunchSandbox.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@ async function main() {
1717
),
1818
];
1919

20+
if (process.argv.includes("--force")) {
21+
args.push("--force");
22+
}
23+
2024
// Install extension dependencies
21-
const process = cp.spawn("code", args, { stdio: "inherit", shell: true });
25+
const subprocess = cp.spawn("code", args, {
26+
stdio: "inherit",
27+
shell: true,
28+
});
2229

2330
await new Promise<void>((resolve, reject) => {
24-
process.on("error", reject);
25-
process.on("exit", (code) => {
31+
subprocess.on("error", reject);
32+
subprocess.on("exit", (code) => {
2633
if (code === 0) {
2734
resolve();
2835
} else {

0 commit comments

Comments
 (0)