From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter indentation for js-mode & cc-mode Date: Thu, 27 Oct 2022 11:28:33 +0200 Message-ID: <87h6zpsji6.fsf@thornhill.no> References: <9AF8BFDC-C9A2-4AE5-A8D2-E6AA05DA3C91@gmail.com> <87k04lljh6.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6177"; mail-complaints-to="usenet@ciao.gmane.io" To: Yuan Fu , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 27 11:32:21 2022 Return-path: Envelope-to: ged-emacs-devel@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 1onzFL-0001Ie-Ie for ged-emacs-devel@m.gmane-mx.org; Thu, 27 Oct 2022 11:32:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onzC1-0005j6-Ac; Thu, 27 Oct 2022 05:28:53 -0400 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 1onzBw-0005XK-1a for emacs-devel@gnu.org; Thu, 27 Oct 2022 05:28:48 -0400 Original-Received: from out0.migadu.com ([94.23.1.103]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onzBn-0007D8-4z for emacs-devel@gnu.org; Thu, 27 Oct 2022 05:28:45 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1666862914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=whPvIiBXy+qbmSpF8q/d48FDG4tWtqlP+rFjKh14BDM=; b=Q83+mpGV0fccu4qJYrYjp8oD/pvBb65k3uFtpN3O73kCoAzY1KeubQU2nHgTgLcyQ4fP7+ ZVYYivHuJSDSjsJo3VvSFlX9LhQBGbk/xIXZn0zh2L5hhFupKIRa/LrZBwtVrL34pTdeQi f0GOIkNxetZgmHEe0fxcCzvL8MNu3Qtaj8b173HTP4MIR0qT4mvwo1Lwdfk5bS7SbNjtb9 oJ6mQZEwVg7wmd38+27QOTMqI2uGdkyCsFgPlfT3Wxzv21asMgUnZG7FwcbPvkoQfcVbHr hrAmV/pp29HSZr26iS0MiZMeRAOnL+IGqjXoC2OWXmY9SYi9HwHSvFSzEQmWtA== In-Reply-To: <87k04lljh6.fsf@thornhill.no> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=94.23.1.103; envelope-from=theo@thornhill.no; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298609 Archived-At: --=-=-= Content-Type: text/plain Theodor Thornhill writes: BTW, I fixed ts-mode. See attached patch :-) Thanks, Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Ensure-we-have-a-treesit-parser-in-mode-init.patch >From f1d9d6f004b16885efd127fa074537028a3805f8 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Thu, 27 Oct 2022 11:26:44 +0200 Subject: [PATCH] Ensure we have a treesit-parser in mode init * lisp/progmodes/ts-mode.el (ts-mode): Create a parser. --- lisp/progmodes/ts-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/ts-mode.el b/lisp/progmodes/ts-mode.el index 28800e378a..61235608c6 100644 --- a/lisp/progmodes/ts-mode.el +++ b/lisp/progmodes/ts-mode.el @@ -261,8 +261,8 @@ ts-mode :syntax-table ts-mode--syntax-table (cond - ((treesit-ready-p nil 'tsx) - ;; Tree-sitter. + ((treesit-ready-p 'ts-mode 'tsx) + (treesit-parser-create 'tsx) ;; Comments. (setq-local comment-start "// ") (setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *") -- 2.34.1 --=-=-=--