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: TypeScript support for tree-sitter (was Re: Call for volunteers: add tree-sitter support to major modes) Date: Tue, 11 Oct 2022 10:42:12 +0200 Message-ID: <87k056hhuj.fsf@thornhill.no> References: <83czb1jrm3.fsf@gnu.org> <87h70b8zqs.fsf@thornhill.no> <835ygrhd1p.fsf@gnu.org> <87bkqj8w8n.fsf@thornhill.no> <877d16ix7h.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12115"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Po Lu , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 11 10:46:04 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 1oiAtn-0002yq-HM for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 10:46:03 +0200 Original-Received: from localhost ([::1]:41516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiAtl-0000kz-FR for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 04:46:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiAqA-0006NV-2J for emacs-devel@gnu.org; Tue, 11 Oct 2022 04:42:18 -0400 Original-Received: from out0.migadu.com ([2001:41d0:2:267::]:33687) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiAq7-0008Bg-BY; Tue, 11 Oct 2022 04:42:16 -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=1665477732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2Kwvn648qGL5csurIJUDwlDXhh8ZIqXPYcUxOCR4rMY=; b=MqyqxdFfaRRwxGvdahmp0HcYYJ6Kr6edl1SyFDUHWgNzYQxETcp5XZ5XIT2lt55NmtblIi soHPlG09PAPcDskuOPBjmaGRTsjPvoVE9rYR3UhzeyY46jaJnBURWGh0Ob0Tw62EE7TcxS LDXvTeMOxFgIxAAZRASO/p/YNZnwbOq8cqWb4U+Z1v+72uuRAiCT+akHbHgRRggOFKLWZK SSXwppH9Jz27bBMUEVOyaFY1p4+w48WksRQnKO82pYfuKeP7QwkEp4t7tc8vHcFmMT4Erx 84qkmWgcqGZo3PY1uMUsegj/Yv1kok7e7sErNEt/ahJ/4q/OyLQ3UHppNymGmg== In-Reply-To: <877d16ix7h.fsf@yahoo.com> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:267::; 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:297453 Archived-At: Po Lu writes: > Yuan Fu writes: > >> +(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode)) >> + >> +;;;###autoload >> +(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode)) >> + >> +(define-derived-mode typescript-mode prog-mode "TypeScript" >> + "Major mode for editing typescript." >> + :group 'typescript >> + :syntax-table typescript-mode--syntax-table >> + >> + (unless (or (treesit-can-enable-p) >> + (treesit-language-available-p 'tsx)) >> + (error "Tree sitter for TypeScript isn't available.")) > > So editing TypeScript source code will cause an error to be signalled > when tree-sitter is not available? No not anymore. I've changed the implementation (Yet to be sent as a patch) to default to using js-mode, as discussed in some other mail around here Thanks, Theo