From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Steinar Bang Newsgroups: gmane.emacs.help Subject: Re: JavaScript/TypeScript: What do people in 2024, on emacs 29, use for .js, .jsx, .ts and .tsx? Date: Wed, 10 Jan 2024 17:21:02 +0100 Message-ID: <87v8816txt.fsf@dod.no> References: <77493010-0b8f-4173-88ed-e726b89a3fad@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3591"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 10 17:21:59 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rNbL5-0000iW-0b for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 10 Jan 2024 17:21:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNbKV-0001mu-Oe; Wed, 10 Jan 2024 11:21:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNbKT-0001lA-1I for help-gnu-emacs@gnu.org; Wed, 10 Jan 2024 11:21:21 -0500 Original-Received: from schwantz.bang.priv.no ([95.217.129.251]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNbKQ-0004fq-Vv for help-gnu-emacs@gnu.org; Wed, 10 Jan 2024 11:21:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dod.no; s=sb; t=1704903662; bh=gCUO+1CtCdr6QM8dDUboOpXoRwbUimM1N4HGTm7V/v0=; h=From:To:Subject:References:Date:In-Reply-To:From; b=kqLci96RtmVn0sYxKUYySO0fnGUzJlhN7n2L02OwCQCwq48LfgXmQAGp1Uux7VHHm yLCR5Nsneep+1vMz/+/jw8q/pasXLDdBLMJTy9DGaYtNz+0Ax8PsXrdHbY7Bytq8t9 TzGINLbTcexS41Dgrg2socyP6HwmI5y9GJ7HNL+o= Original-Received: from marquez (unknown [84.210.69.52]) by schwantz.bang.priv.no (Postfix) with ESMTPSA id 8818B59B for ; Wed, 10 Jan 2024 16:21:02 +0000 (UTC) In-Reply-To: <77493010-0b8f-4173-88ed-e726b89a3fad@gutov.dev> (Dmitry Gutov's message of "Tue, 9 Jan 2024 19:32:31 +0200") Received-SPF: none client-ip=95.217.129.251; envelope-from=sb@dod.no; helo=schwantz.bang.priv.no X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145713 Archived-At: >>>>> Dmitry Gutov : > js-mode handles JSX indeed, but it's inevitaby limited in what it > understands about its syntax (it uses sgml-mode under the covers to do > highlighting, but I'm sure there would be odd edge cases). Ah, ok. Thanks for the update! > The latest new option in 29.1 is js-ts-mode (which uses tree-sitter > parser and supports JSX too). It should provide the most accurate > highlighting and reliable indentation, Hm... interesting! I ran into the tree-sitter thing, yesterday, while looking for documentation for the the js-mode of emacs 29. > 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.