-
-
Notifications
You must be signed in to change notification settings - Fork 91
Add sandbox setup cmd for VSCodium #2989
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
Changes from 8 commits
db3ab51
9edd9ad
963c0e4
5d67e7f
c7b00dd
18b145a
498aca0
3caf6ef
1593ee4
7c80580
148ff04
3b58880
687bd4c
85a3c3f
75605c0
4692560
811221e
7d74c0c
36ff867
b4803f4
f679748
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# Contributing | ||
|
||
Welcome! So glad you've decided to help make Cursorless better. You'll want to start by getting [set up](#initial-setup) and learning how to [run / test a local copy of the | ||
extension](#running--testing-extension-locally). You may also find the [VSCode API docs](https://code.visualstudio.com/api) helpful to learn about VSCode extension development. | ||
Welcome! So glad you've decided to help make Cursorless better. You'll want to start by getting [set up](#initial-setup) and learning how to [run / test a local copy of the extension](#running--testing-extension-locally). You may also find the [VSCode API docs](https://code.visualstudio.com/api) helpful to learn about VSCode extension development. | ||
|
||
## Initial setup | ||
|
||
|
@@ -10,7 +12,8 @@ extension](#running--testing-extension-locally). You may also find the [VSCode A | |
- [Git](https://git-scm.com/) | ||
- [Node.js](https://nodejs.org/en/) | ||
- [Corepack](https://nodejs.org/api/corepack.html) or [pnpm](https://pnpm.io/installation) | ||
- [VSCode](https://code.visualstudio.com/); minimum version for local development is 1.72.0 in order to support settings profiles for sandboxed development. Please file an issue if that is a problem. | ||
- [VSCode](https://code.visualstudio.com/) or [VSCodium](https://vscodium.com/); Please file an issue if you are unable to use [settings profiles](https://code.visualstudio.com/updates/v1_72#_settings-profiles), as they are required for the development environment. | ||
rinOfTheStars marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Both VSCode and VSCodium will be referred to as VSCode except when instructions differ between the editors. | ||
|
||
### Steps | ||
|
||
|
@@ -22,32 +25,62 @@ extension](#running--testing-extension-locally). You may also find the [VSCode A | |
pnpm install | ||
pnpm compile | ||
``` | ||
Don't fret if `pnpm compile` fails! While required for running tests locally on your machine, you will still be able to run tests through GitHub Actions, and it will not prevent you from contributing otherwise. | ||
|
||
|
||
4. Run | ||
4. Run the following in the terminal: | ||
|
||
```bash | ||
code --profile=cursorlessDevelopment | ||
``` | ||
<Tabs groupId="vsx"> | ||
<TabItem value="vscode" label="VSCode" default> | ||
```bash | ||
code --profile=cursorlessDevelopment | ||
``` | ||
</TabItem> | ||
<TabItem value="vscodium" label="VSCodium"> | ||
```bash | ||
codium --profile=cursorlessDevelopment | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
|
||
and then close the window that opens (eg say `"window close"`). This step is necessary to create the [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. Once https://github.com/microsoft/vscode/issues/172046 is resolved, we will be able to remove this step, as the profile can then automatically be created. | ||
and then close the window that opens (eg say `"window close"`). This step is necessary to create the [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. Once https://github.com/microsoft/vscode/issues/172046 is resolved, we will be able to remove this step, as the profile can then automatically be created. | ||
rinOfTheStars marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
5. Run the following in the terminal: | ||
|
||
```bash | ||
pnpm init-vscode-sandbox | ||
``` | ||
|
||
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: | ||
|
||
```bash | ||
code --profile=cursorlessDevelopment --install-extension some.extension | ||
``` | ||
<Tabs groupId="vsx"> | ||
<TabItem value="vscode" label="VSCode"> | ||
```bash | ||
pnpm init-vscode-sandbox | ||
``` | ||
</TabItem> | ||
<TabItem value="vscodium" label="VSCodium"> | ||
```bash | ||
pnpm init-vscode-sandbox | ||
``` | ||
VSCodium users will also need to manually download and install the `jrieken:vscode-tree-sitter-query` extension, as it is [currently not avalible](https://github.com/jrieken/vscode-tree-sitter-query/issues/28) on the OpenVSX Marketplace. | ||
Instructions on how to manually download the extension can be found [in this Stack Overflow post](https://stackoverflow.com/a/79565372) ([archived](https://web.archive.org/web/20250421130639/https://stackoverflow.com/questions/79359919/how-can-i-manually-download-vsix-files-now-that-the-vs-code-marketplace-no-long/79565372#79565372)), while manual installation instructions can be found directly below—replace `some.extension` with the acquired `.vsix` file's path instead of an extension id. | ||
rinOfTheStars marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
</TabItem> | ||
</Tabs> | ||
|
||
Said command adds extensions to the aforementioned settings profile 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: | ||
|
||
<Tabs groupId="vsx"> | ||
<TabItem value="vscode" label="VSCode"> | ||
```bash | ||
code --profile=cursorlessDevelopment --install-extension some.extension | ||
``` | ||
</TabItem> | ||
<TabItem value="vscodium" label="VSCodium"> | ||
```bash | ||
codium --profile=cursorlessDevelopment --install-extension some.extension | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
|
||
where `some.extension` is the id of the extension you'd like to install into the sandbox. | ||
|
||
Note that you do not need to install the Cursorless extension into the `cursorlessDevelopment` profile. A local development version of Cursorless will be automatically installed there every time you debug the extension, as described below. | ||
|
||
Also note that if you are adding support for a new language that isn't in the default list of [language identifiers](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers) supported by VSCode, you may need to add an extension dependency. See [Adding a new language](./adding-a-new-language.md#2-ensure-file-type-is-supported-by-vscode) for more details. | ||
Also note that if you are adding support for a new language that isn't in the default list of [language identifiers](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers) supported by VSCode/VSCodium, you may need to add an extension dependency. See [Adding a new language](./adding-a-new-language.md#2-ensure-file-type-is-supported-by-vscode) for more details. | ||
rinOfTheStars marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
rinOfTheStars marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
6. Copy / symlink [`cursorless-talon-dev`](../../cursorless-talon-dev) into your Talon user directory for some useful voice commands for developing Cursorless. | ||
|
||
|
@@ -106,9 +139,18 @@ vsce package -o bundle.vsix | |
|
||
Once you have your package then you can install it into the sandbox using the following command: | ||
|
||
``` | ||
code --profile=cursorlessDevelopment --install-extension bundle.vsix | ||
``` | ||
<Tabs groupId="vsx"> | ||
<TabItem value="vscode" label="VSCode"> | ||
```bash | ||
code --profile=cursorlessDevelopment --install-extension bundle.vsix | ||
``` | ||
</TabItem> | ||
<TabItem value="vscodium" label="VSCodium"> | ||
```bash | ||
codium --profile=cursorlessDevelopment --install-extension bundle.vsix | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
|
||
## Installing a local build of the Cursorless extension | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.