aboutsummaryrefslogtreecommitdiff
path: root/book/src
diff options
context:
space:
mode:
authorMichael Davis2022-02-16 13:57:20 +0000
committerBlaž Hrastnik2022-03-10 08:31:57 +0000
commit4fc991fdeca5db36bd7be7197510e62a019e1677 (patch)
tree03ce0022ba5f6aa71adf1c81214d05db8a84f035 /book/src
parent08ee949dcb904dc27aa41a62ad686c14c0a406bb (diff)
migrate grammar fetching/building code into helix-loader crate
This is a rather large refactor that moves most of the code for loading, fetching, and building grammars into a new helix-loader module. This works well with the [[grammars]] syntax for languages.toml defined earlier: we only have to depend on the types for GrammarConfiguration in helix-loader and can leave all the [[language]] entries for helix-core.
Diffstat (limited to 'book/src')
-rw-r--r--book/src/guides/adding_languages.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/book/src/guides/adding_languages.md b/book/src/guides/adding_languages.md
index 51256288..e000770c 100644
--- a/book/src/guides/adding_languages.md
+++ b/book/src/guides/adding_languages.md
@@ -51,16 +51,16 @@ Grammar configuration takes these keys:
| Key | Description |
| --- | ----------- |
| `name` | The name of the tree-sitter grammar |
-| `path` | A path within the grammar directory which should be built. Some grammar repositories host multiple grammars (for example `tree-sitter-typescript` and `tree-sitter-ocaml`) in subdirectories. This key is used to point `hx --build-grammars` to the correct path for compilation. When ommitted, the root of the grammar directory is used |
| `source` | The method of fetching the grammar - a table with a schema defined below |
Where `source` is a table with either these keys when using a grammar from a
git repository:
-| Key | Description |
-| --- | ----------- |
-| `git` | A git remote URL from which the grammar should be cloned |
-| `rev` | The revision (commit hash or tag) which should be fetched |
+| Key | Description |
+| --- | ----------- |
+| `git` | A git remote URL from which the grammar should be cloned |
+| `rev` | The revision (commit hash or tag) which should be fetched |
+| `subpath` | A path within the grammar directory which should be built. Some grammar repositories host multiple grammars (for example `tree-sitter-typescript` and `tree-sitter-ocaml`) in subdirectories. This key is used to point `hx --build-grammars` to the correct path for compilation. When omitted, the root of repository is used |
Or a `path` key with an absolute path to a locally available grammar directory.