all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Steinar Bang <sb@dod.no>, help-gnu-emacs@gnu.org
Subject: Re: JavaScript/TypeScript: What do people in 2024, on emacs 29, use for .js, .jsx, .ts and .tsx?
Date: Sun, 14 Jan 2024 23:00:04 +0200	[thread overview]
Message-ID: <f6bd959c-676f-4027-9824-29677af227b8@gutov.dev> (raw)
In-Reply-To: <877ckd7kr6.fsf@dod.no>

On 13/01/2024 09:30, Steinar Bang wrote:
>>>>>> Steinar Bang <sb@dod.no>:
>>>>>> Dmitry Gutov <dmitry@gutov.dev>:
> 
>>> but some features (like tag splitting?) might have to be reimplemented
>>> anew. Should be easier to do that using tree-sitter parse tree than
>>> with sgml-mode. Perhaps if rjsx-mode has an implementation, it
>>> wouldn't be too hard to port it.
> 
>> I'll do a dive into the rjsx code and see if I can identify where it
>> does tag splitting and post back on the thread here.
> 
> Harder than I thought... parsing and manipulation of the buffer seems
> interweaved, but perhaps here:
>   https://github.com/felipeochoa/rjsx-mode/blob/master/rjsx-mode.el#L452

Doesn't look like that: rjsx-parse-xml seems like a routine to parse and 
return an xml parse node.

> If you have something like
>   <Home/>
> and you type a ">" after "Home", i.e.
>   <Home></>
> then the "</>" is immediately expanded to "</Home>"
>   <Home></Home>

Seems like it's the command called 'rjsx-electric-gt' defined here: 
https://github.com/felipeochoa/rjsx-mode/blob/b697fe4d92cc84fa99a7bcb476f815935ea0d919/rjsx-mode.el#L916

> And it, sort of, kind of, looks like the above code is the one doing it, maybe...?
> 
> (Couldn't figure out where js2-DIV and friends were defined so I don't
> know what it matches)

js2-DIV is defined in js2-mode.el (which is a dependency). The value is 
a number which denoted the node type. But might be unnecessary, given 
the above.



  reply	other threads:[~2024-01-14 21:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 12:12 JavaScript/TypeScript: What do people in 2024, on emacs 29, use for .js, .jsx, .ts and .tsx? Steinar Bang
2024-01-09 17:32 ` Dmitry Gutov
2024-01-10 16:21   ` Steinar Bang
2024-01-13  7:30     ` Steinar Bang
2024-01-14 21:00       ` Dmitry Gutov [this message]
2024-01-22 13:54         ` Steinar Bang

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=f6bd959c-676f-4027-9824-29677af227b8@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=help-gnu-emacs@gnu.org \
    --cc=sb@dod.no \
    /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.