unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Karan Ahlawat <ahlawatkaran12@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Setting up indent-on-type in a treesit based major-mode
Date: Mon, 21 Oct 2024 00:39:41 +0530	[thread overview]
Message-ID: <a5bbe997-798c-4040-822c-f87fbc8402dd@gmail.com> (raw)

Hello,

Today I was using ruby-ts-mode and found out that it can indent some 
keywords as soon as they're typed out fully (example, when inside a case 
block). I'd love to implement such a feature in scala-ts-mode, so I 
looked at the source code, but could not see anything special it might 
be doing besides simple treesit indent setup.

So, how does it exactly achieve this indent-on-type behavior (I can see 
the matcher being called if I set treesit--indent-verbose to t), and how 
could I reproduce this in my own major-mode?

Thanks,

Karan


                 reply	other threads:[~2024-10-20 19:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=a5bbe997-798c-4040-822c-f87fbc8402dd@gmail.com \
    --to=ahlawatkaran12@gmail.com \
    --cc=help-gnu-emacs@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.
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).