From debbugs-submit-bounces@debbugs.gnu.org Tue May 28 12:32:01 2024 Received: (at submit) by debbugs.gnu.org; 28 May 2024 16:32:01 +0000 Received: from localhost ([127.0.0.1]:46848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBzk1-0006Hj-Bh for submit@debbugs.gnu.org; Tue, 28 May 2024 12:32:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:45250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBzjz-0006Ha-1U for submit@debbugs.gnu.org; Tue, 28 May 2024 12:31:59 -0400 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 1sBzjp-0004Ql-AH for bug-gnu-emacs@gnu.org; Tue, 28 May 2024 12:31:49 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBzjn-0003fv-NW for bug-gnu-emacs@gnu.org; Tue, 28 May 2024 12:31:49 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id F3C221C0002 for ; Tue, 28 May 2024 16:31:41 +0000 (UTC) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: Limit matches of treesit-thing-settings in js-ts-mode Organization: LINKOV.NET X-Debbugs-Cc: Yuan Fu Date: Tue, 28 May 2024 19:24:56 +0300 Message-ID: <86a5k9c3zf.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=2001:4b98:dc4:8::225; envelope-from=juri@linkov.net; helo=relay5-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, 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-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --=-=-= Content-Type: text/plain Navigation in js-ts-mode is still quite unusable when "expression" in 'js--treesit-sexp-nodes' matches "expression_statement". Whereas it should match only "expression" and "parenthesized_expression". So here is the patch that adds delimiters "\\_<" and "\\_>" around node names by 'js--regexp-opt-symbol' (and adds some useful nodes as well): --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=js--treesit-sexp-nodes.patch diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 6cb84592896..f5629ff8fbe 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3829,6 +3829,8 @@ js--treesit-sentence-nodes (defvar js--treesit-sexp-nodes '("expression" + "parenthesized_expression" + "formal_parameters" "pattern" "array" "function" @@ -3846,7 +3848,12 @@ js--treesit-sexp-nodes "undefined" "arguments" "pair" - "jsx") + "jsx" + "statement_block" + "object" + "object_pattern" + "named_imports" + "class_body") "Nodes that designate sexps in JavaScript. See `treesit-thing-settings' for more information.") @@ -3889,10 +3896,10 @@ js-ts-mode (setq-local treesit-thing-settings `((javascript - (sexp ,(regexp-opt js--treesit-sexp-nodes)) - (sentence ,(regexp-opt js--treesit-sentence-nodes)) - (text ,(regexp-opt '("comment" - "template_string")))))) + (sexp ,(js--regexp-opt-symbol js--treesit-sexp-nodes)) + (sentence ,(js--regexp-opt-symbol js--treesit-sentence-nodes)) + (text ,(js--regexp-opt-symbol '("comment" + "template_string")))))) ;; Fontification. (setq-local treesit-font-lock-settings js--treesit-font-lock-settings) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 31 02:35:43 2024 Received: (at 71244) by debbugs.gnu.org; 31 May 2024 06:35:43 +0000 Received: from localhost ([127.0.0.1]:53032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCvrb-0004wG-DH for submit@debbugs.gnu.org; Fri, 31 May 2024 02:35:43 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:33773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCvrX-0004vs-12; Fri, 31 May 2024 02:35:41 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 6E8F520005; Fri, 31 May 2024 06:35:19 +0000 (UTC) From: Juri Linkov To: 71244@debbugs.gnu.org Subject: Re: bug#71244: Limit matches of treesit-thing-settings in js-ts-mode In-Reply-To: <86a5k9c3zf.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 28 May 2024 19:24:56 +0300") Organization: LINKOV.NET References: <86a5k9c3zf.fsf@mail.linkov.net> Date: Fri, 31 May 2024 09:34:39 +0300 Message-ID: <86y17q1ocg.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71244 Cc: Yuan Fu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 71244 30.0.50 thanks > Navigation in js-ts-mode is still quite unusable > when "expression" in 'js--treesit-sexp-nodes' > matches "expression_statement". Whereas it should match > only "expression" and "parenthesized_expression". > > So here is the patch that adds delimiters "\\_<" and "\\_>" > around node names by 'js--regexp-opt-symbol' (and adds > some useful nodes as well): With no objections, this is pushed now. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 06 01:22:16 2024 Received: (at 71244) by debbugs.gnu.org; 6 Jun 2024 05:22:16 +0000 Received: from localhost ([127.0.0.1]:38909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sF5Zo-0006xw-DA for submit@debbugs.gnu.org; Thu, 06 Jun 2024 01:22:16 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:48415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sF5Zm-0006xb-7C for 71244@debbugs.gnu.org; Thu, 06 Jun 2024 01:22:14 -0400 Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-70276322ad8so563312b3a.1 for <71244@debbugs.gnu.org>; Wed, 05 Jun 2024 22:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717651254; x=1718256054; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cPzGjZPLHMGP20vJ5rPuuZQvYA6LaV8/DabNshqZWeo=; b=MTFLO4Ysk5QjweegtH3UZm2Pr/fXWRvOH9Repcg50+pFjlYsV6SnCZvgheossXhqAH aGnn78yXyaPasfgfz17dbnX3bMlFQExluYdOiucN6Bh7Eh55Spuzh/BjRXgrxVq4nwVW LZg3vc8zlgdWtT3lLUThb17RxG2lGOFzfC19lpjxCne1AoaBDeIbeC5QCJSN95ipNmCL 1u1WeYWgdf+L7ampQr06PLcK6YJY6dajnLDHbva9AnK9ACOZYmtUfISIqWe7AW0BA1v+ pTj97J+Jtcu4Gee92hy6lzInLoBtqse8kQaUOrasjZOxI5bIrmAV8wAEdWrurV8fStsm /95A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717651254; x=1718256054; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cPzGjZPLHMGP20vJ5rPuuZQvYA6LaV8/DabNshqZWeo=; b=p5644nqNrJrFLplPtIX1Lb6OvqO09XRsqM99C7q13aaNgqpB/J14p/qyDGjyimepov CBckxl8aMuphzqa6J5jRdDbf1KceggvWvkjDIuIuj29A92EBppG62GD7bQ+Fk/O3/7sb aVXWQT1FYdXbi2kR15usScx+S86Svtep/5fa0osuA6cdFhxaixQ+lroI3A//7imrxO8r oKrCjtJ7C744nyN9MEWVZnuHN7jSXPfZyQ5MBaePde3GW0LXqCdew0b3GHJlfQuSgOC4 6phszFeYnrnTl1z4X67D+DQHwvXka5+zgnMrUSNHf+0dXorOfrVAD3CvZN2ZNvSgSmK/ TU4w== X-Gm-Message-State: AOJu0Yyfj0Fl/VZ+Ui48GZT8RxVwDKfftMbBERergEd2xKiKzcTq7J4p UzjjHB+bZ8PuVGzNOIrpCv7144LT4oF9fhe3UJEub8EUsCbfGwRRB9uGbw== X-Google-Smtp-Source: AGHT+IEqfKX+ggury4yoQcDwd28HKnEi6WNb8gSEbC2BKbG43zqP+2eMAkeTubnhiz3EOB7oYcfFDQ== X-Received: by 2002:a05:6a21:3286:b0:1b2:9d35:41f7 with SMTP id adf61e73a8af0-1b2b716edfcmr5510452637.58.1717651253460; Wed, 05 Jun 2024 22:20:53 -0700 (PDT) Received: from smtpclient.apple ([2601:646:8f81:f810:6d47:6e61:bc5f:51a3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-703fd49527bsm365997b3a.106.2024.06.05.22.20.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2024 22:20:52 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: bug#71244: Limit matches of treesit-thing-settings in js-ts-mode From: Yuan Fu In-Reply-To: <86y17q1ocg.fsf@mail.linkov.net> Date: Wed, 5 Jun 2024 22:20:41 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <1563F75B-3126-4987-9B67-2A10E960EBDC@gmail.com> References: <86a5k9c3zf.fsf@mail.linkov.net> <86y17q1ocg.fsf@mail.linkov.net> To: Juri Linkov X-Mailer: Apple Mail (2.3774.600.62) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71244 Cc: 71244@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On May 30, 2024, at 11:34=E2=80=AFPM, Juri Linkov = wrote: >=20 > close 71244 30.0.50 > thanks >=20 >> Navigation in js-ts-mode is still quite unusable >> when "expression" in 'js--treesit-sexp-nodes' >> matches "expression_statement". Whereas it should match >> only "expression" and "parenthesized_expression". >>=20 >> So here is the patch that adds delimiters "\\_<" and "\\_>" >> around node names by 'js--regexp-opt-symbol' (and adds >> some useful nodes as well): >=20 > With no objections, this is pushed now. Thanks Juri! Yuan= From unknown Mon Aug 18 00:07:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 04 Jul 2024 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator