Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewfraser committed May 21, 2019
1 parent 232c28e commit 0825e86
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ It's straightforward to add any [language with a tree-sitter grammar](https://tr

1. Add a dependency on the npm package for that language: `npm install tree-sitter-yourlang`.
2. Rebuild the dependency for electron `./scripts/electron-rebuild.sh`.
3. Add the language to the [dictionary at the top of ./lib/extension.ts](https://github.com/georgewfraser/vscode-tree-sitter/blob/fb4400b78481845c6a8497d079508d28aea25c19/src/extension.ts#L6).
3. Add the language and color function to the [dictionary at the top of ./lib/extension.ts](https://github.com/georgewfraser/vscode-tree-sitter/blob/232c28e3708bb8f1913d5d067f1c9668f263d5b2/src/extension.ts#L5).
4. Add a **simplified** TextMate grammar to `./src/yourlang.tmLanguage.json`. The job of this textmate grammar is just to color keywords and literals.
5. Add a reference to the grammar to the [contributes.grammars section of package.json](https://github.com/georgewfraser/vscode-tree-sitter/blob/fb4400b78481845c6a8497d079508d28aea25c19/package.json#L26). `yourlang` must be a [VSCode language identifier](https://code.visualstudio.com/docs/languages/identifiers).
6. Add a reference to `onLanguage:yourlang` to the [activationEvents section of package.json](https://github.com/georgewfraser/vscode-tree-sitter/blob/fb4400b78481845c6a8497d079508d28aea25c19/package.json#L18). `yourlang` must be a [VSCode language identifier](https://code.visualstudio.com/docs/languages/identifiers).
7. Add an example to `examples/yourlang`.
8. Hit `F5` in VSCode, with this project open, to test your changes.
9. You may need to make adjustments to the [color function](https://github.com/georgewfraser/vscode-tree-sitter/blob/fb4400b78481845c6a8497d079508d28aea25c19/src/extension.ts#L135) that converts tree-sitter scopes into VSCode colors. Uncommenting [console.log(rootNode)](https://github.com/georgewfraser/vscode-tree-sitter/blob/fb4400b78481845c6a8497d079508d28aea25c19/src/extension.ts#L123) may be helpful for figuring out what scopes tree-sitter is finding in your code.
10. Take a screenshot comparing before-and-after and add it to the above list.
12. Submit a PR!
9. Take a screenshot comparing before-and-after and add it to the above list.
10. Submit a PR!

## Customizing colors

Expand Down

0 comments on commit 0825e86

Please sign in to comment.