all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arash Esbati <arash@gnu.org>
To: Pankaj Jangid <pankaj@codeisgreat.org>
Cc: emacs-devel@gnu.org
Subject: Re: treesit-language-source-alist: Presets and/or custom variable?
Date: Thu, 19 Jan 2023 16:17:57 +0100	[thread overview]
Message-ID: <86fsc6o8nu.fsf@gnu.org> (raw)
In-Reply-To: <874jsm4t6f.fsf@codeisgreat.org> (Pankaj Jangid's message of "Thu, 19 Jan 2023 17:45:04 +0530")

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



  reply	other threads:[~2023-01-19 15:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 11:50 treesit-language-source-alist: Presets and/or custom variable? Arash Esbati
2023-01-18 12:52 ` Ruijie Yu via Emacs development discussions.
2023-01-18 12:53 ` Eli Zaretskii
2023-01-18 13:43   ` Arash Esbati
2023-01-19 12:15 ` Pankaj Jangid
2023-01-19 15:17   ` Arash Esbati [this message]
2023-01-20  4:23     ` Pankaj Jangid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86fsc6o8nu.fsf@gnu.org \
    --to=arash@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=pankaj@codeisgreat.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.