From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Cassou Newsgroups: gmane.emacs.devel Subject: Re: Adding jsdoc support to js-ts-mode Date: Fri, 14 Jun 2024 14:39:50 +0200 Message-ID: <87ikybem09.fsf@cassou.me> References: <871q59w5jm.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21706"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu To: Dmitry Gutov , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 15 07:47:27 2024 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 1sIMG7-0005TB-4f for ged-emacs-devel@m.gmane-mx.org; Sat, 15 Jun 2024 07:47:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIMF9-0008OW-9z; Sat, 15 Jun 2024 01:46:27 -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 1sI6Dl-0001XQ-5Z for emacs-devel@gnu.org; Fri, 14 Jun 2024 08:39:57 -0400 Original-Received: from mail.reprendre.net ([193.23.30.35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sI6Dj-0000Wz-0O for emacs-devel@gnu.org; Fri, 14 Jun 2024 08:39:56 -0400 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D4D782C9C23; Fri, 14 Jun 2024 14:39:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cassou.me; s=dkim; t=1718368791; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=MhephPNL4ggr+Hi5kaMyUAwF40Wc38xtu1ylgBep1RI=; b=L3Z1l2HCq9JGZWuQdTY99mJu2hlWclbgOsjkjSqWMvewcWqEZndqWVBvsiHswvIfLzSMBC UJbeovA/SmI787zbsPipioh3Nt7Y1OWvpnIhk2dZJ48X1hNwDrBxpG3wKSM738NSDyCiqt SNfGFIzmsZjJFkRBXSA3hoRFgLfbLTOmy3K8dl+PpAiu9qtlpOJG6Anx0jpWXCaAWsfi93 Ch1JGRRP5ifqCiEhlWtCfcctx/boBMNOzf2FHKKFEKx6eDRWVg9DeIkuIgEJGS4nsFuM3x ceV6JHuS/PxhW+HsMGu3WUn6wI0tZrH++T7L2aHG4AkCQlK7EuTD3OWsRFg4KA== In-Reply-To: X-Last-TLS-Session-Version: TLSv1.3 Received-SPF: pass client-ip=193.23.30.35; envelope-from=damien@cassou.me; helo=mail.reprendre.net 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_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 15 Jun 2024 01:46:26 -0400 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320096 Archived-At: Hi Dmitry, Dmitry Gutov writes: > You could try adding a custom rule which applies highlights to specific > ranges. The function to call is treesit-fontify-with-override. I've just opened bug#71550 with a patch to add jsdoc support to `js-ts-mode'. It seems like using `treesit-fontify-with-override' wasn't necessary after all in the master branch. >> (setq-local treesit-language-at-point-function #js-ts-language-at-point) > Seems like this needs ' after #. Indeed, thank you! Thank you for your help -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill