unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Damien Cassou <damien@cassou.me>
Cc: emacs-devel@gnu.org
Subject: Re: Support multiple tree-sitter grammars
Date: Sun, 07 May 2023 13:59:38 +0300	[thread overview]
Message-ID: <83ild4e7ad.fsf@gnu.org> (raw)
In-Reply-To: <873548to4k.fsf@cassou.me> (message from Damien Cassou on Sun, 07 May 2023 12:46:51 +0200)

> From: Damien Cassou <damien@cassou.me>
> Date: Sun, 07 May 2023 12:46:51 +0200
> 
> Hi,
> 
> some files may consist of several parts requiring different tree-sitter
> grammars. For example, a JavaScript file may have its documentation
> written with jsdoc: JavaScript and jsdoc have a tree-sitter grammar
> each.
> 
> Is there a way to use a tree-sitter grammar in parts of the file and
> another one in other parts? There could be a main grammar and secondary
> grammars would be activated on some kinds of nodes of the main one.

Yes, it should be possible, AFAIU.  See the node "Multiple Languages"
in the ELisp manual, I believe it explains how to do what you want.



      reply	other threads:[~2023-05-07 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-07 10:46 Support multiple tree-sitter grammars Damien Cassou
2023-05-07 10:59 ` Eli Zaretskii [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83ild4e7ad.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=damien@cassou.me \
    --cc=emacs-devel@gnu.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).