From 4fc991fdeca5db36bd7be7197510e62a019e1677 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 16 Feb 2022 07:57:20 -0600 Subject: 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. --- book/src/guides/adding_languages.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'book/src/guides/adding_languages.md') 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. -- cgit v1.2.3-70-g09d2