[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: treesit-language-source-alist: Presets and/or custom variable?
From: |
Arash Esbati |
Subject: |
Re: treesit-language-source-alist: Presets and/or custom variable? |
Date: |
Thu, 19 Jan 2023 16:17:57 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 |
Pankaj Jangid <pankaj@codeisgreat.org> writes:
> How to compile for langs like "tsx", which requires different value for
> "sourcedir" and "grammardir" in the helper build.sh script?
,----[ C-h v treesit-language-source-alist RET ]
| treesit-language-source-alist is a variable defined in ‘treesit.el’.
|
| Its value is nil
|
| Configuration for downloading and installing tree-sitter language grammars.
|
| The value should be an alist where each element has the form
|
| (LANG . (URL REVISION SOURCE-DIR CC C++))
|
| Only LANG and URL are mandatory. LANG is the language symbol.
| URL is the Git repository URL for the grammar.
|
| REVISION is the Git tag or branch of the desired version,
| defaulting to the latest default branch.
|
| SOURCE-DIR is the relative subdirectory in the repository in which
| the grammar’s parser.c file resides, defaulting to "src".
|
| CC and C++ are C and C++ compilers, defaulting to "cc" and
| "c++", respectively.
|
`----
IIUC, SOURCE-DIR is what you're looking for. Something like this should
do the trick:
(setq treesit-language-source-alist
'((tsx . ("https://github.com/tree-sitter/tree-sitter-typescript.git"
nil "tsx/src"))))
Best, Arash