Skip to content

Commit

Permalink
Clarify extension dependency instructions for adding a new language (#…
Browse files Browse the repository at this point in the history
…1903)

Following a discussion on Slack between Andreas and River about the
Elixir PR tests failing, it seems like the docs needed to be updated to
clarify how to add an extension dependency when adding support for a
language type that vscode isn't natively aware of.

## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] 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

---------

Co-authored-by: fidgetingbits <[email protected]>
Co-authored-by: Pokey Rule <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2023
1 parent 128933a commit 5c069e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/contributing/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ extension](#running--testing-extension-locally). You may also find the [VSCode A
code --profile=cursorlessDevelopment --install-extension some.extension
```

where `some.extension` is the id of the extension you'd like to install into the sandbox
where `some.extension` is the id of the extension you'd like to install into the sandbox.

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.

6. Copy / symlink `cursorless-talon-dev` into your Talon user directory for some useful voice commands for developing Cursorless.

Expand Down
6 changes: 5 additions & 1 deletion docs/contributing/adding-a-new-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ of a document. See the
[docs](https://github.com/pokey/vscode-parse-tree/#adding-a-new-language) there
for how to add support for a new parser

## 2. Define parse tree patterns in Cursorless
## 2. Ensure file type is supported by VSCode

If you are adding support for a new language that isn't natively detected by VSCode, you will need to add the appropriate extension to the list of dependencies. The list of languages officially supported by VSCode is listed [in the VSCode docs](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers). If your language is in that list, you can skip this step and proceed to step 3. If your language is not in that list, you need to find a VSCode extension that adds support for your language, and add the id of the given extension to [`packages/common/src/extensionDependencies.ts`](../../packages/common/src/extensionDependencies.ts) and then re-run `pnpm init-vscode-sandbox` to ensure it is installed. If you do not do this you will encounter errors when attempting to execute cursorless commands in the next step. See [#1895](https://github.com/cursorless-dev/cursorless/issues/1895) for more info.

## 3. Define parse tree patterns in Cursorless

First a few notes / tips:

Expand Down

0 comments on commit 5c069e3

Please sign in to comment.