From unknown Tue Jun 17 20:32:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#66183 <66183@debbugs.gnu.org> To: bug#66183 <66183@debbugs.gnu.org> Subject: Status: elixir-ts-mode test failure Reply-To: bug#66183 <66183@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:32:07 +0000 retitle 66183 elixir-ts-mode test failure reassign 66183 emacs submitter 66183 john muhl severity 66183 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 24 14:08:31 2023 Received: (at submit) by debbugs.gnu.org; 24 Sep 2023 18:08:31 +0000 Received: from localhost ([127.0.0.1]:43587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkTWx-0003Ov-3p for submit@debbugs.gnu.org; Sun, 24 Sep 2023 14:08:31 -0400 Received: from lists.gnu.org ([2001:470:142::17]:38312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkTWs-0003Oa-7A for submit@debbugs.gnu.org; Sun, 24 Sep 2023 14:08:29 -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 1qkTWa-0003ck-OQ for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 14:08:08 -0400 Received: from out-203.mta1.migadu.com ([95.215.58.203]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkTWY-00053D-IA for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 14:08:08 -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=pub.pink; s=key1; t=1695578881; 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: content-transfer-encoding:content-transfer-encoding; bh=CjVl+ltkNdfM5TMthhP8z6O47udga3yS5TNYI6gI5CY=; b=a5hi7Telvv99C+RWOixtXnQhNGpjSKTO7FmoxdAAIBfqIzngZu3xZ2l2XAQ5NvhUjy167d 5yNfJcVRBRxtBg07RzLJGYkD8S1JOlBumC6inYcGKNWOiXyp94eENfyNw7I83lKT4mdCLK MGsoNPyv8UCbX5AzbcLqywEfl5yCsoU= From: john muhl To: bug-gnu-emacs@gnu.org Subject: elixir-ts-mode test failure Date: Sun, 24 Sep 2023 11:53:19 -0500 Message-ID: <87fs33wiki.fsf@pub.pink> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.203; envelope-from=jm@pub.pink; helo=out-203.mta1.migadu.com 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_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit 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: -0.1 (/) The change in 5cba5ee8905 caused an elixir test to start failing. The white space at the start of the test is now in a heex range so pressing tab there matches a heex rule instead of the elixir one. Moving the dummy range to the end fixes the test. --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -722,7 +722,7 @@ treesit-update-ranges ;; language, set it's range to a dummy (1 ;; . 1), otherwise it would be set to the ;; whole buffer, which is not what we want. - `((,(point-min) . ,(point-min)))))))))))) + `((,(point-max) . ,(point-max)))))))))))) Running 1 tests (2023-09-24 11:52:17-0500, selector =E2=80=98t=E2=80=99) Test elixir-ts-mode-test-indentation backtrace: signal(ert-test-failed (("Mismatch in test \"Basic modules\", file / ert-fail(("Mismatch in test \"Basic modules\", file /home/jm/src/ema ert-test--erts-test(((dummy . t) (code)) "/home/jm/src/emacs/test/li ert-test-erts-file("/home/jm/src/emacs/test/lisp/progmodes/elixir-ts (closure (t) nil (let ((value-4 (gensym "ert-form-evaluation-aborted ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test ert-run-test(#s(ert-test :name elixir-ts-mode-test-indentation :docu ert-run-or-rerun-test(#s(ert--stats :selector t :tests [#s(ert-test=20 ert-run-tests(t #f(compiled-function (event-type &rest event-args) # ert-run-tests-batch(nil) ert-run-tests-batch-and-exit() command-line-1(("-l" "ert" "-l" "/home/jm/src/emacs/lisp/progmodes/e command-line() normal-top-level() Test elixir-ts-mode-test-indentation condition: (ert-test-failed ("Mismatch in test \"Basic modules\", file /home/jm/src/emacs/test/lis= p/progmodes/elixir-ts-mode-resources/indent.erts" #( " defmodule Foobar do\n def bar() do\n \"one\"\n end\n end\n" 0 65 (fontified nil)) "defmodule Foobar do\n def bar() do\n \"one\"\n end\nend\n")) FAILED 1/1 elixir-ts-mode-test-indentation (0.053512 sec) at ../../src= /emacs/test/lisp/progmodes/elixir-ts-mode-tests.el:26 Ran 1 tests, 0 results as expected, 1 unexpected (2023-09-24 11:52:17-0500,= 0.118489 sec) 1 unexpected results: FAILED elixir-ts-mode-test-indentation From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 24 23:13:24 2023 Received: (at 66183) by debbugs.gnu.org; 25 Sep 2023 03:13:24 +0000 Received: from localhost ([127.0.0.1]:43815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkc2G-0006jj-7u for submit@debbugs.gnu.org; Sun, 24 Sep 2023 23:13:24 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:45240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkc2B-0006jT-3n for 66183@debbugs.gnu.org; Sun, 24 Sep 2023 23:13:23 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1c451541f23so38106455ad.2 for <66183@debbugs.gnu.org>; Sun, 24 Sep 2023 20:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695611581; x=1696216381; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=NCmkzf41Z6W/BRxA66H+RPvWCmzexgzuH4Y1xmpl7Fg=; b=JGP/lp4+d9kBB/CwToj/DjhweCHZ8y6DP6SR4UgyhmJqNk6WT2KhNVoaIROX/w7eX3 qllY8MDpECH/oXY8NX2XKtITxZ0SVPsz10mP1pIF5cJpybxhhzHYcYUzzPNrE/OVo0y9 lJeURhimNOwf65vw0f79ihkeMeOdJ+5sNLqCO04gWFDTl/Uxf9akPLnUeD+w7VRCzlHl FHUmHijAWGrRMBDyca8kB6vtlJboXorJGLdEqAyFYXKnfz1S1izrArkL8jfvrn7P4BQV RSC4T/EOnWPr6AVKfNgdtNtvK3rX7tblODFUFCYItwOx1s6VuOqcnCJjcOTeKDxTy89q vouQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695611581; x=1696216381; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NCmkzf41Z6W/BRxA66H+RPvWCmzexgzuH4Y1xmpl7Fg=; b=PDbKHpU/AOuQyPQ8mesvMSL5dHD7ySZ6Kq5Q0zbZyYer4xA5m5mt4elG8YIoRih5fU jifdsrLRnVrxaxiq7cGrOUre8U8vem5gD1TSFEM7rEFLCd66jOxZRJ/jnomNd2HDjnGn ZC7c2NrKVnO21xoKUbyzMoKvAjWhsQu28ZlHMCi3eVtfbD+uQzJ1r1DpCQRvLH6bq+ZM RN/sxpWh3+mrhF5EUd4JiZObHYyFqMc6hvghfOfu7kkA11HOsVGKV+xFzkYNNAJhCarS VW8u24uJ38iGmKhUMc7PetePcE7q+an5r5/t8/l39QN/eH2c/Dfya/KsAnOSJuT+C59I mdMA== X-Gm-Message-State: AOJu0Yzht0RgTJCf60UmUkdtwiiUad9qNEz+xd2qtoIzt4jD4t/IfTwp 477BJh9I8kyhdP9Gl6cfW6U= X-Google-Smtp-Source: AGHT+IG7fb9Ov7AczQj1ajJZoh8QFzZ1OLMjVKzOH2eHMeWkrPhR2+4eAbJ7Y544PmeY+CrnohFysQ== X-Received: by 2002:a17:902:ed05:b0:1c6:d34:5279 with SMTP id b5-20020a170902ed0500b001c60d345279mr1994785pld.13.1695611580620; Sun, 24 Sep 2023 20:13:00 -0700 (PDT) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id q16-20020a170902dad000b001c0cb2aa2easm7485492plx.121.2023.09.24.20.12.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Sep 2023 20:13:00 -0700 (PDT) From: Yuan Fu Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_49D4DE6F-AC9E-4C51-BBB3-CF2930CF3873" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#66183: elixir-ts-mode test failure Date: Sun, 24 Sep 2023 20:12:48 -0700 In-Reply-To: <87fs33wiki.fsf@pub.pink> To: john muhl References: <87fs33wiki.fsf@pub.pink> X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66183 Cc: 66183@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 (-) --Apple-Mail=_49D4DE6F-AC9E-4C51-BBB3-CF2930CF3873 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 24, 2023, at 9:53 AM, john muhl via Bug reports for GNU Emacs, = the Swiss army knife of text editors wrote: >=20 > The change in 5cba5ee8905 caused an elixir test to start failing. The > white space at the start of the test is now in a heex range so = pressing > tab there matches a heex rule instead of the elixir one. Moving the > dummy range to the end fixes the test. Thank you. I=E2=80=99ll make sure to remember also running elixir tests = when I make a change. I looked around and found elixir-mode=E2=80=99s language-at-point = function works in a way that isn=E2=80=99t what tree-sitter functions = expect. Tree-sitter functions expect the major mode to derive language = at point by querying the host language and do some pattern matching, = rather than using language parser=E2=80=99s range. I took a quick look = at elixir=E2=80=99s grammar and came up with this version for a POC. You = probably need to adjust it but the idea is there. With the new language-at-point definition, treesit-language-at can = return the correct language, and the test passes again. Yuan --Apple-Mail=_49D4DE6F-AC9E-4C51-BBB3-CF2930CF3873 Content-Disposition: attachment; filename=example.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="example.diff" Content-Transfer-Encoding: 7bit diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 7175fe4bff8..31a25ccadcf 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -510,21 +510,13 @@ elixir-ts--treesit-anchor-grand-parent-bol (defun elixir-ts--treesit-language-at-point (point) "Return the language at POINT." - (let* ((range nil) - (language-in-range - (cl-loop - for parser in (treesit-parser-list) - do (setq range - (cl-loop - for range in (treesit-parser-included-ranges parser) - if (and (>= point (car range)) (<= point (cdr range))) - return parser)) - if range - return (treesit-parser-language parser)))) - (if (null language-in-range) - (when-let ((parser (car (treesit-parser-list)))) - (treesit-parser-language parser)) - language-in-range))) + (let* ((node (treesit-node-at point 'elixir))) + (if (and (equal (treesit-node-type node) "quoted_content") + (string-match-p + (rx bos (or "H" "F") eos) + (treesit-node-text (treesit-node-prev-sibling node)))) + 'heex + 'elixir))) (defun elixir-ts--defun-p (node) "Return non-nil when NODE is a defun." --Apple-Mail=_49D4DE6F-AC9E-4C51-BBB3-CF2930CF3873-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 25 15:05:03 2023 Received: (at 66183) by debbugs.gnu.org; 25 Sep 2023 19:05:03 +0000 Received: from localhost ([127.0.0.1]:46679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkqtD-0002M7-1c for submit@debbugs.gnu.org; Mon, 25 Sep 2023 15:05:03 -0400 Received: from out-197.mta1.migadu.com ([95.215.58.197]:23765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkqt7-0002Lb-Qv for 66183@debbugs.gnu.org; Mon, 25 Sep 2023 15:05:01 -0400 References: <87fs33wiki.fsf@pub.pink> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; s=key1; t=1695668684; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0WaUd6uXqq/zOOf9rMR4ii3pn8EdIHkHJ6IjGkn2hH0=; b=A1PBj0f++Q8u7+qii/ZszuIBFllR0emG7b5qjjSOUH/nxpIsWGYI227C/5RYRroW8RC7R5 sGM6SmcDkKi437TLBgdmOeMeY8O8SBHbyK5Jo6YMV2YZvqwpjelIGFlRwlR7TJff51+3NG F4KOjklzj5exSMWeHTMNPPRFKUPKFB0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: john muhl To: Yuan Fu Subject: Re: bug#66183: elixir-ts-mode test failure Date: Mon, 25 Sep 2023 11:01:57 -0500 In-reply-to: Message-ID: <874jji3whk.fsf@pub.pink> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Yuan Fu writes: >> On Sep 24, 2023, at 9:53 AM, john muhl via Bug reports for GNU >> Emacs, the Swiss army knife of text editors >> wrote: >> >> The change in 5cba5ee8905 caused an elixir test [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Debbugs-Envelope-To: 66183 Cc: Wilhelm H Kirschbaum , 66183@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: 0.1 (/) Yuan Fu writes: >> On Sep 24, 2023, at 9:53 AM, john muhl via Bug reports for GNU >> Emacs, the Swiss army knife of text editors >> wrote: >>=20 >> The change in 5cba5ee8905 caused an elixir test to start failing. The >> white space at the start of the test is now in a heex range so pressing >> tab there matches a heex rule instead of the elixir one. Moving the >> dummy range to the end fixes the test. > > Thank you. I=E2=80=99ll make sure to remember also running elixir tests w= hen I > make a change. > > I looked around and found elixir-mode=E2=80=99s language-at-point function > works in a way that isn=E2=80=99t what tree-sitter functions expect. > Tree-sitter functions expect the major mode to derive language at > point by querying the host language and do some pattern matching, > rather than using language parser=E2=80=99s range. I took a quick look at > elixir=E2=80=99s grammar and came up with this version for a POC. You pro= bably > need to adjust it but the idea is there. Thanks for checking. Actually I was just looking at why the tests were failing but now see that I forgot to include the elixir mode maintainer. > With the new language-at-point definition, treesit-language-at can > return the correct language, and the test passes again. Wilhelm could you have a look? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 26 02:18:43 2023 Received: (at 66183) by debbugs.gnu.org; 26 Sep 2023 06:18:43 +0000 Received: from localhost ([127.0.0.1]:47081 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ql1P9-0007Fp-2Y for submit@debbugs.gnu.org; Tue, 26 Sep 2023 02:18:43 -0400 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:46221) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ql1P5-0007Fa-On for 66183@debbugs.gnu.org; Tue, 26 Sep 2023 02:18:41 -0400 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-4194d89a6dfso4909841cf.0 for <66183@debbugs.gnu.org>; Mon, 25 Sep 2023 23:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695709101; x=1696313901; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lAskuwHdHN0AJbtCbIdgiFOboqmBsXrU4//9JZ0xSgs=; b=GYeW9MV3kpfJK7i/6YPiUBf4RILmOzFZbgr6+vG6uWVWbyPUouiA5vbVO0YpZV1oJ0 z1jvSSFaJMozb/Iyqe58cBtyw9Hkh5PA9VE1SPOY3AoWhvmP4TrdhEbEkRzwrI7pfIKH bQv3BfbJUo7xCnrhhEunO6tXOVIf+iQpBX+0Ii/1Z4LmuIbmsFfC33iXFStyz7EcxmY5 6b7zOUfV3QT+37mSvF6dHPI+cuhPm3m/MD7QMTyoaTr6tW+jKL6wFoPMq0Qbv8Wu3OF0 WAxVGa52EZWIbd2jbTJIhVt7dP4w4mWcy2jJKaZWwQL8DAbzpmPkwg7u5A1m8XbkL5el Xe8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695709101; x=1696313901; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lAskuwHdHN0AJbtCbIdgiFOboqmBsXrU4//9JZ0xSgs=; b=CchdojSoejpd9tq26CthUddY3lGpR5LHhvwDiepyW+amGLXHZ90CeTZXPM2MVO9Ksd Biqd9lYHNyeZexcsapALTCV4wHDGCyS8GNmHyYCe4o+irQIrz6IlnGPfYH/oaeV5cg8r KAcK+v4t9gRLf0rQUH/56nlSEfeHXNN3MBrkU7MLvFXuoVXMqeHgQjpD85yhX8PmK/K0 QZC+vEmuAoebPGHNFth8m+3C72ElFhk51ZiSOZRUoyBdAL70YpyHhBBP5EfSJRNZg2B9 1uz8V0mc8Kpfh5wIzYw/T+XJ1NBm+1vyeI35lJpIy/ApkJvH/TLGo+STIFmjiSQVCGJQ A0wA== X-Gm-Message-State: AOJu0YyD3XAhFCQYQ5j/uePJuW+lbSvvOLIfbCfaWeUHxF9UA9WzIr+w oCdblKGh/KsUdFsm6nxJ90JPIXo3NDyy4MOsxC8= X-Google-Smtp-Source: AGHT+IG4W4f+UtpylKNZ0IWPA8RQkOszubN3rFXGv+Pt+WSbNhSoWOrQ/THMc24P/QwrdQRf2WX30zhbxvgQ9W4YkSs= X-Received: by 2002:ac8:660c:0:b0:418:19dd:9238 with SMTP id c12-20020ac8660c000000b0041819dd9238mr4226055qtp.45.1695709101313; Mon, 25 Sep 2023 23:18:21 -0700 (PDT) MIME-Version: 1.0 References: <87fs33wiki.fsf@pub.pink> <874jji3whk.fsf@pub.pink> In-Reply-To: <874jji3whk.fsf@pub.pink> From: Wilhelm Kirschbaum Date: Tue, 26 Sep 2023 08:18:10 +0200 Message-ID: Subject: Re: bug#66183: elixir-ts-mode test failure To: john muhl Content-Type: multipart/alternative; boundary="000000000000a0542206063d0a48" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66183 Cc: 66183@debbugs.gnu.org, 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.0 (-) --000000000000a0542206063d0a48 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Sep 25, 2023 at 9:04=E2=80=AFPM john muhl wrote: > Yuan Fu writes: > > > With the new language-at-point definition, treesit-language-at can > > return the correct language, and the test passes again. > > Wilhelm could you have a look? > I will have a look later today. --000000000000a0542206063d0a48 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Sep 25, 2023 at 9:04=E2=80=AFPM john muhl <= ;jm@pub.pink> wrote:
Yuan Fu <casouri@gmail.com> writes:

> With the new language-at-point definition, treesit-language-at can
> return the correct language, and the test passes again.

Wilhelm could you have a look?

=C2=A0I = will have a look later today.
--000000000000a0542206063d0a48-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 26 12:41:16 2023 Received: (at submit) by debbugs.gnu.org; 26 Sep 2023 16:41:16 +0000 Received: from localhost ([127.0.0.1]:49639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlB7b-0001kV-Mm for submit@debbugs.gnu.org; Tue, 26 Sep 2023 12:41:16 -0400 Received: from lists.gnu.org ([2001:470:142::17]:43200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlB7W-0001k0-Hf for submit@debbugs.gnu.org; Tue, 26 Sep 2023 12:41:12 -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 1qlB7D-00081C-PJ for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 12:40:51 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qlB7C-0001s7-7U for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 12:40:51 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-405361bb949so99553455e9.1 for ; Tue, 26 Sep 2023 09:40:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695746448; x=1696351248; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=DozGtKA2QNRXGlQP4dyHN16ct64nCZODT+lDG7J18Qo=; b=ULoz/mLCgF2aF9HC/opgf4UznF4VpPwQJ3NMomC7QRRcbgxrau3WJ6R8FMPsRf9yp8 IpBSoO5OusViAWHIgEOQjkdYZxN5rWJ3TXqyO9Y7EywkeHfHut2t8Kqw6GQ/Jq+MKXds xa2saHSLt3jKGpN8yMnyXbL0uU7CmKxR0CmQSZ5MQakQU81c5+Ew+LQuUGwDKwwQg7UN myvO8TfXSA32zYjUHR+w14mwfsJ2JQlzC8VwLgAJ+8qOk6tcZNx83RsKvzwIrPh/YIRN X20Bet/jhhGU44vVmYQeE0is8rE3duUlwrGxmSsPa9WXyEEhlShc5dLRceR0tG1hdn7B n9vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695746448; x=1696351248; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=DozGtKA2QNRXGlQP4dyHN16ct64nCZODT+lDG7J18Qo=; b=qg/wVsoQT71UG8n6aHRZwEM3AsDME6qo04Ju5byYXfYITKbw9EhOVY5CoDVotmvgxS 2x4Ty6RuQZjWtKzuO8DUPWv9vX2kNdDL5k8/EDBLT6KPlFzONFdcaKzl1h2dzLcmVyTW +8leMZjqEwxEHuoh/dMKepKTyVZ9ISmTPVFA/e8eyex7Ww/Q8OcK4Xfc6O3Sj0yL5u3q mPqnzwMCrEkJ/c3lIxR+X1vGxs6LZxU9tK/b+otFbENIE0KXujk7TTEjtWVsW4m4OP0Z NyYj1f1WvCtZisBYmXeHzLJ+dDA2A9D8JHTiexY5fKRNOm6qruIxr4V1VX2xIkOmnbFX rDIA== X-Gm-Message-State: AOJu0YykSaVYT/zICikd05f4eQ480fkovIgSMuZEodGHoIEfj7PAhtPw TNBSNeXV+uuWMdFWQ57yfV87PbI9svH4L+h4 X-Google-Smtp-Source: AGHT+IGmVASSxC01ju773kTgWh9NECQusu0NpdNe7qfFBxHHU7z7RAAo5eqRmekkvqkaL8/DL0sj2A== X-Received: by 2002:adf:fd8b:0:b0:31c:8c93:61e3 with SMTP id d11-20020adffd8b000000b0031c8c9361e3mr8948859wrr.60.1695746447798; Tue, 26 Sep 2023 09:40:47 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id g16-20020adfa490000000b003232380ffd5sm7037082wrb.106.2023.09.26.09.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 09:40:47 -0700 (PDT) References: <87fs33wiki.fsf@pub.pink> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Yuan Fu Subject: Re: bug#66183: elixir-ts-mode test failure Date: Tue, 26 Sep 2023 18:30:37 +0200 In-reply-to: Message-ID: <874jjg51mc.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=wkirschbaum@gmail.com; helo=mail-wm1-x329.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: 66183@debbugs.gnu.org, bug-gnu-emacs@gnu.org, john muhl 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: -0.0 (/) Yuan Fu writes: >> On Sep 24, 2023, at 9:53 AM, john muhl via Bug reports for GNU >> Emacs, the Swiss army knife of text editors=20 >> >> wrote: >>=20 >> The change in 5cba5ee8905 caused an elixir test to start=20 >> failing. The >> white space at the start of the test is now in a heex range so=20 >> pressing >> tab there matches a heex rule instead of the elixir one. Moving=20 >> the >> dummy range to the end fixes the test. > > Thank you. I=E2=80=99ll make sure to remember also running elixir tests=20 > when I make a change. > > I looked around and found elixir-mode=E2=80=99s language-at-point=20 > function > works in a way that isn=E2=80=99t what tree-sitter functions > expect. Tree-sitter functions expect the major mode to derive=20 > language > at point by querying the host language and do some pattern=20 > matching, > rather than using language parser=E2=80=99s range. I took a quick look=20 > at > elixir=E2=80=99s grammar and came up with this version for a POC. You=20 > probably Sorry about that. I had absolutely no idea how it was expected to=20 work. > need to adjust it but the idea is there. > > With the new language-at-point definition, treesit-language-at=20 > can > return the correct language, and the test passes again. > > Yuan > > [2. text/x-patch; example.diff]... This seems to work if you set named on: treesit-node-prev-sibling, otherwise it just tries to match the \"\"\" against H or F. (let* ((node (treesit-node-at point 'elixir))) (if (and (equal (treesit-node-type node) "quoted_content") (string-match-p (rx bos (or "H" "F") eos) - (treesit-node-text (treesit-node-prev-sibling=20 node)))) + (treesit-node-text (treesit-node-prev-sibling node=20 t)))) 'heex 'elixir))) I will spend some time in the next couple of hours to catch up to=20 all the changes. Wilhelm From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 26 14:00:57 2023 Received: (at 66183) by debbugs.gnu.org; 26 Sep 2023 18:00:57 +0000 Received: from localhost ([127.0.0.1]:49703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlCMi-0006Zp-Fu for submit@debbugs.gnu.org; Tue, 26 Sep 2023 14:00:56 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:50337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlCMh-0006Zb-0o for 66183@debbugs.gnu.org; Tue, 26 Sep 2023 14:00:55 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1bf55a81eeaso66758325ad.0 for <66183@debbugs.gnu.org>; Tue, 26 Sep 2023 11:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695751236; x=1696356036; 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=39CMf8PeIOxZo61MZZ+zYwpanUz61k/ASiUZt1Ninto=; b=bsqpUI5y5dfp3d2aDjkL7xvjCZyFFxdWHl56iFqMXlMmZT9DA0JbRmwk/nzIdi7XIM PIKnerN6Iled1KsTV8Dp5vnUjMlHkzTTF4ZtH3Hy51lYQ3EQNYNiPO/Q2lAQGwsXh+XF mn7kz9fGQ3lTz6gL+p1jI4MiK2xgb1TyNogpI5NYGhhFTYYyVWf9AQzR3CXlxctk0iZM SglrtHYo/8q/ukzRfp7wlLmMTlwR40jrCfN2inTjM4DyfHl+lpBygNZqMQZQk/gDoVhl ATkOdiFhmvRovRgRZDXYlxg9HoabLs0mSaDHI6xDFZkKfGtLo0TrGL//TAgcXFbUtyo7 KKVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695751236; x=1696356036; 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=39CMf8PeIOxZo61MZZ+zYwpanUz61k/ASiUZt1Ninto=; b=arpO/rokUh7Sce+gJK71CPFHgyHahJEEWfdoQuWsJWwPiJgriHrNcty0Z5TycuKS/1 iKk6dLOu7XLX6ZrKF34+7aAozoTfQtuF1t3KFX9VTHdGO1mU3orBOyhAZQ+24KtX/QkL vmx0dO0YzHP6u+nK/Yb6Zry4qmiHgDQA3SHrnTGYgnDFyYxHcPX+FjTcvJ7+aBSJpN3H 87aZylaxvLm31D+2zAsgk86kLOqqoQ6pTCZrxSYLVABuR6KiccmtKaQ37hVjx/Qc02MW IarpDlQnaobZy8OHKWmzj0kJB4GxTc4zJN7IALUxZGcQAf7U8TJ7x97wKqndQJdad9hT +xqQ== X-Gm-Message-State: AOJu0YzbAmVK3xWncOkg8mhj+bPJo9GsJpBhYvSL/c0bnm+ra/yg192j n8L3zelv79c+jINzM6+hFKE= X-Google-Smtp-Source: AGHT+IHD5N0i4ff+djM/Su1ZUAjtJN7e4LjCg5Vo+xu+CAWjNrLEGF1NgOPqGVEe82Kh8GO0YxLolg== X-Received: by 2002:a17:903:1cb:b0:1c7:22ae:4081 with SMTP id e11-20020a17090301cb00b001c722ae4081mr409064plh.27.1695751235785; Tue, 26 Sep 2023 11:00:35 -0700 (PDT) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id l13-20020a170902f68d00b001b54d064a4bsm11307057plg.259.2023.09.26.11.00.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Sep 2023 11:00:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#66183: elixir-ts-mode test failure From: Yuan Fu In-Reply-To: <874jjg51mc.fsf@gmail.com> Date: Tue, 26 Sep 2023 11:00:23 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87fs33wiki.fsf@pub.pink> <874jjg51mc.fsf@gmail.com> To: Wilhelm Kirschbaum X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66183 Cc: 66183@debbugs.gnu.org, Bug Report Emacs , john muhl 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 Sep 26, 2023, at 9:30 AM, Wilhelm Kirschbaum = wrote: >=20 >=20 > Yuan Fu writes: >=20 >>> On Sep 24, 2023, at 9:53 AM, john muhl via Bug reports for GNU >>> Emacs, the Swiss army knife of text editors >>> wrote: >>> The change in 5cba5ee8905 caused an elixir test to start failing. = The >>> white space at the start of the test is now in a heex range so = pressing >>> tab there matches a heex rule instead of the elixir one. Moving the >>> dummy range to the end fixes the test. >>=20 >> Thank you. I=E2=80=99ll make sure to remember also running elixir = tests when I make a change. >>=20 >> I looked around and found elixir-mode=E2=80=99s language-at-point = function >> works in a way that isn=E2=80=99t what tree-sitter functions >> expect. Tree-sitter functions expect the major mode to derive = language >> at point by querying the host language and do some pattern matching, >> rather than using language parser=E2=80=99s range. I took a quick = look at >> elixir=E2=80=99s grammar and came up with this version for a POC. You = probably >=20 > Sorry about that. I had absolutely no idea how it was expected to = work. It=E2=80=99s absolutely my fault :-) Several people have had confusion = about it, because the docstring wasn=E2=80=99t clear enough. I=E2=80=99ve = updated the docstring so hopefully this confusion won=E2=80=99t occur in = the future. >=20 >> need to adjust it but the idea is there. >>=20 >> With the new language-at-point definition, treesit-language-at can >> return the correct language, and the test passes again. >>=20 >> Yuan >>=20 >> [2. text/x-patch; example.diff]... >=20 > This seems to work if you set named on: treesit-node-prev-sibling, > otherwise it just tries to match the \"\"\" against H or F. >=20 > (let* ((node (treesit-node-at point 'elixir))) > (if (and (equal (treesit-node-type node) "quoted_content") > (string-match-p > (rx bos (or "H" "F") eos) > - (treesit-node-text (treesit-node-prev-sibling = node)))) > + (treesit-node-text (treesit-node-prev-sibling node = t)))) > 'heex > 'elixir))) >=20 > I will spend some time in the next couple of hours to catch up to all > the changes. Ah, right. I=E2=80=99ll leave the specifics to you. As long as the = language is derived from the node at point rather than parser range, it = will be fine. Also, there=E2=80=99s no rush. Yuan From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 26 16:39:17 2023 Received: (at submit) by debbugs.gnu.org; 26 Sep 2023 20:39:17 +0000 Received: from localhost ([127.0.0.1]:49949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlEpw-0002jp-LJ for submit@debbugs.gnu.org; Tue, 26 Sep 2023 16:39:17 -0400 Received: from lists.gnu.org ([2001:470:142::17]:54556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlEpt-0002jO-3Q for submit@debbugs.gnu.org; Tue, 26 Sep 2023 16:39:13 -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 1qlEpa-0006MX-8j for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 16:38:54 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qlEpY-0001AZ-JA for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 16:38:54 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3214cdb4b27so9125045f8f.1 for ; Tue, 26 Sep 2023 13:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695760731; x=1696365531; darn=gnu.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=F0MQGKCanN0VZOq+6A/RrhCYkLf2ZS6lmv/HJ//Kjj4=; b=l2MorQii8bpV8N7slCEN1Nm6R3sruVD+Rbl2nHvMa9I97O44/AIXDpbcDFAjnhtChl +UZfIfh42TFv/vmsNtomRn7mYI9U4vl8pQUJwXeEMX+B15AYkDk7Ei336T3DcF51l0fk uvvc2tGieqF6QDTepunD2Bi4YuTdfaEzVwa5GpscudIUrjQvNGklS+GqNiHtahipBLZY /2HqHdRarrhw5gbdbEh38q4uenOyBh3t72xUo0Z/5RpPS9cfOAC2O6CNv3ssJvNzgWk2 CJ+OgdfaZtcQc3ntN8j13evGuMnfsp2Gn9TDFDr7gW+SKKig7X2JRJQbJYkPVWEjzWPF pFKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695760731; x=1696365531; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=F0MQGKCanN0VZOq+6A/RrhCYkLf2ZS6lmv/HJ//Kjj4=; b=dXOdUkLcwNeyrPBc2dcsrHmNkOMc6FT+W7H/JTD9+Eq+kv2jHBhIm5N3iyQSNxhVcf Eqz6PTYSl+ZRM0V8K2uFpmUpwpmDIHyY8AwnYtCmqPEusJxeR/FDYrJwcO6QFfkYc6Oa nYuXokP/ytY/Y77rNkQWHzLTvPooIAB32mx0G8nJNwEX2+izqpzYxFH0Z/hNwkEhYRG3 bic5K13Y0Xa8XXl6MGuygvL0xxeYPb2vYnPPu28536JW3+fUUt7RFVSle9RmBT9OWBiZ mSU7YSpgjl3rc/8MXd5sTavs0JzGe5XVQOieEO02X2OHvkn7UluZfakPOwmN99lelDiP cAhQ== X-Gm-Message-State: AOJu0YwRibRf/Bo/wqlpAZjCJiypFljH9RA4M4v4NhIX5RSmAr+wtz2Z esrJNRo5GbhFrtbHxomsB6Uas7wm3PKuFHeb X-Google-Smtp-Source: AGHT+IF2lZXXFw3e3zZF326KN7bFi+CszpNBSV9CfFuFNNbXeUR7tWv+Wi7qKYT5p2S+LxcXJu/rHg== X-Received: by 2002:adf:fe4a:0:b0:31f:8e7c:6ebe with SMTP id m10-20020adffe4a000000b0031f8e7c6ebemr11333410wrs.5.1695760730575; Tue, 26 Sep 2023 13:38:50 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id bv19-20020a0560001f1300b0032327b70ef6sm6840553wrb.70.2023.09.26.13.38.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 13:38:50 -0700 (PDT) References: <87fs33wiki.fsf@pub.pink> <874jjg51mc.fsf@gmail.com> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Yuan Fu Subject: Re: bug#66183: elixir-ts-mode test failure Date: Tue, 26 Sep 2023 22:26:11 +0200 In-reply-to: Message-ID: <87r0mky8iy.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=wkirschbaum@gmail.com; helo=mail-wr1-x429.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: 66183@debbugs.gnu.org, Bug Report Emacs , john muhl 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: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable >>> need to adjust it but the idea is there. >>>=20 >>> With the new language-at-point definition, treesit-language-at=20 >>> can >>> return the correct language, and the test passes again. >>>=20 >>> Yuan >>>=20 >>> [2. text/x-patch; example.diff]... >>=20 >> This seems to work if you set named on:=20 >> treesit-node-prev-sibling, >> otherwise it just tries to match the \"\"\" against H or F. >>=20 >> (let* ((node (treesit-node-at point 'elixir))) >> (if (and (equal (treesit-node-type node) "quoted_content") >> (string-match-p >> (rx bos (or "H" "F") eos) >> - (treesit-node-text (treesit-node-prev-sibling=20 >> node)))) >> + (treesit-node-text (treesit-node-prev-sibling=20 >> node t)))) >> 'heex >> 'elixir))) >>=20 >> I will spend some time in the next couple of hours to catch up=20 >> to all >> the changes. > > Ah, right. I=E2=80=99ll leave the specifics to you. As long as the=20 > language is derived from the node at point rather than parser=20 > range, it will be fine. Also, there=E2=80=99s no rush. > Hi Yuan, With the new changes I had to update some indentation rules as=20 well. The following patch was tested against a couple of elixir files. There is another indentation issue with HEEx embeds, but think its unrelated to this issue and will have a look this weekend. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-treesit-langauge-at-point-for-elixir-ts-mode.patch Content-Description: Fix treesit-language-at-point for elixir-ts-mode >From 046950eb63b5499ab7f60434c5ebd0bbe5ada274 Mon Sep 17 00:00:00 2001 From: Wilhelm H Kirschbaum Date: Tue, 26 Sep 2023 21:32:40 +0200 Subject: [PATCH] Fix treesit-langauge-at-point for elixir-ts-mode. The treesit-language-at-point function is only suppose to query the host language. * lisp/progmodes/elixir-ts-mode.el (elixir-ts--indent-rules): Add missing rules. (elixir-ts--treesit-language-at-point): Update function to only query the host language. * test/lisp/progmodes/elixir-ts-mode-resources/indent.erts: Add test for inline docs. --- lisp/progmodes/elixir-ts-mode.el | 35 ++++++++++--------- .../elixir-ts-mode-resources/indent.erts | 16 +++++++++ 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 7175fe4bff8..fd4400c6c53 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -312,7 +312,16 @@ elixir-ts--indent-rules ((parent-is "^catch_block$") parent ,offset) ((parent-is "^keywords$") parent-bol 0) ((node-is "^call$") parent-bol ,offset) - ((node-is "^comment$") parent-bol ,offset))))) + ((node-is "^comment$") parent-bol ,offset) + ((node-is "\"\"\"") parent-bol 0) + ;; Handle quoted_content indentation on the last + ;; line before the closing \"\"\", where it might + ;; see it as no-node outside a HEEx tag. + (no-node (lambda (_n _p _bol) + (treesit-node-start + (treesit-node-parent + (treesit-node-at (point) 'elixir)))) + 0))))) (defvar elixir-ts--font-lock-settings (treesit-font-lock-rules @@ -510,21 +519,15 @@ elixir-ts--treesit-anchor-grand-parent-bol (defun elixir-ts--treesit-language-at-point (point) "Return the language at POINT." - (let* ((range nil) - (language-in-range - (cl-loop - for parser in (treesit-parser-list) - do (setq range - (cl-loop - for range in (treesit-parser-included-ranges parser) - if (and (>= point (car range)) (<= point (cdr range))) - return parser)) - if range - return (treesit-parser-language parser)))) - (if (null language-in-range) - (when-let ((parser (car (treesit-parser-list)))) - (treesit-parser-language parser)) - language-in-range))) + (let ((node (treesit-node-at point 'elixir))) + (if (and (equal (treesit-node-type node) "quoted_content") + (let ((prev-sibling (treesit-node-prev-sibling node t))) + (when (treesit-node-p prev-sibling) + (string-match-p + (rx bos (or "H" "F") eos) + (treesit-node-text (treesit-node-prev-sibling node t)))))) + 'heex + 'elixir))) (defun elixir-ts--defun-p (node) "Return non-nil when NODE is a defun." diff --git a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts index 1f855d3c977..fe09a37a32b 100644 --- a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts @@ -330,6 +330,22 @@ Name: Long tuple "October", "November", "December"} =-=-= +Name: Doc + +=-= +defmodule Foo do +""" + bar + """ +end +=-= +defmodule Foo do + """ + bar + """ +end +=-=-= + Name: Embedded HEEx =-= -- 2.42.0 --=-=-= Content-Type: text/plain; format=flowed Wilhelm --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 27 02:46:57 2023 Received: (at 66183-done) by debbugs.gnu.org; 27 Sep 2023 06:46:57 +0000 Received: from localhost ([127.0.0.1]:50347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlOK0-000510-D3 for submit@debbugs.gnu.org; Wed, 27 Sep 2023 02:46:57 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:49521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlOJp-00050d-IL for 66183-done@debbugs.gnu.org; Wed, 27 Sep 2023 02:46:55 -0400 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso7847722a12.3 for <66183-done@debbugs.gnu.org>; Tue, 26 Sep 2023 23:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695797186; x=1696401986; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=zYjr//+jkrrMjCB5JQLcci6UzvASTvFMvjAhYNkNeAw=; b=hvbBvtj+Y/H6UNHXzQz7aCRWN2KngD56MFEL1e7TbEiC6HIoQWiXfU4GPD2vJQ32M0 Hjs/n8qUhzLl7yaTbibt61urfLdbzfzHhbYyMinQMH+QbdIcOC0qyFzywdWa1SYrp+eT TLNb3wl6wJMyy3lWJvCB4XF7BY3Qk+MrkYyJEAOE8ROTGe87xfpn1sg1QFZMCnkPZcve i2ktzPmIxAGO7yhSEpb87v/lTgKTYv/r5x7AAoWj3Tg6HVVyxQrn4bSlNgeIOQUZ9XPt BPDL3kDfoa6mBd17g7oQkN2CxSrrX6D1mIVIuDpB2aQORcZtmpkcPlxpwnzy/BZRh5AI +dSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695797186; x=1696401986; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zYjr//+jkrrMjCB5JQLcci6UzvASTvFMvjAhYNkNeAw=; b=YQ6mwJ9dqCcDQ6tIEVczbJomudus0APBcLEX6hbh4rB7rApHsHOZVLynmoHanM4T7z BspueZfkDw4n/NKkgYNR7VNelyAkeUrQhPjyKn1LbXe8CKljC88h/Uz7Om/IyKu3LfRr oprTW1AW0Hv5ref2zWVhqeG5Qz/4zfpmO1ZGUaHiV9hSpb1eBoDnLSqS8hOhjIwfGjGs pzqX+Rjw9tbhaSrGDBW0SaNz7Gwyl55f8CeM6RnqdUILL1F3YTzN7pLw63owW9MC9LK3 oXLbh8dg82ahP/STMTGKqDolVejqV37FhAizaGzN8sb8uKWUR/OHF3JopT7zxYJx7/n0 9Z+g== X-Gm-Message-State: AOJu0YyDtWIRXUaKpIyYlFMtUFPZeGkeLDjHUy11DY3ZGO7+MupvDa1s v6IJNLDJfIlJpUrh/vVVFbk= X-Google-Smtp-Source: AGHT+IFtMQMM51mWEfUss9R7+bY1QUuWPFkLK01FRAUmnwsmOkfY+h4Vp3adCKBFcLptIQMXSA/7tQ== X-Received: by 2002:a05:6a21:7881:b0:12e:73bb:cbb6 with SMTP id bf1-20020a056a21788100b0012e73bbcbb6mr1329177pzc.14.1695797185908; Tue, 26 Sep 2023 23:46:25 -0700 (PDT) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id m10-20020a170902768a00b001c7276398f1sm540108pll.164.2023.09.26.23.46.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Sep 2023 23:46:25 -0700 (PDT) From: Yuan Fu Message-Id: <9B77101A-02DA-4ED2-868C-A2D5AD353AA3@gmail.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_FA921786-86E2-4647-9441-2E165BB9B6CC" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#66183: elixir-ts-mode test failure Date: Tue, 26 Sep 2023 23:46:13 -0700 In-Reply-To: <87r0mky8iy.fsf@gmail.com> To: Wilhelm Kirschbaum References: <87fs33wiki.fsf@pub.pink> <874jjg51mc.fsf@gmail.com> <87r0mky8iy.fsf@gmail.com> X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66183-done Cc: Bug Report Emacs , john muhl , 66183-done@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 (-) --Apple-Mail=_FA921786-86E2-4647-9441-2E165BB9B6CC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 26, 2023, at 1:26 PM, Wilhelm Kirschbaum = wrote: >=20 >>>> need to adjust it but the idea is there. >>>> With the new language-at-point definition, treesit-language-at can >>>> return the correct language, and the test passes again. >>>> Yuan >>>> [2. text/x-patch; example.diff]... >>> This seems to work if you set named on: treesit-node-prev-sibling, >>> otherwise it just tries to match the \"\"\" against H or F. >>> (let* ((node (treesit-node-at point 'elixir))) >>> (if (and (equal (treesit-node-type node) "quoted_content") >>> (string-match-p >>> (rx bos (or "H" "F") eos) >>> - (treesit-node-text (treesit-node-prev-sibling = node)))) >>> + (treesit-node-text (treesit-node-prev-sibling node = t)))) >>> 'heex >>> 'elixir))) >>> I will spend some time in the next couple of hours to catch up to = all >>> the changes. >>=20 >> Ah, right. I=E2=80=99ll leave the specifics to you. As long as the = language is derived from the node at point rather than parser range, it = will be fine. Also, there=E2=80=99s no rush. >>=20 >=20 > Hi Yuan, >=20 > With the new changes I had to update some indentation rules as well. > The following patch was tested against a couple of elixir files. >=20 > There is another indentation issue with HEEx embeds, but think its > unrelated to this issue and will have a look this weekend. >=20 --Apple-Mail=_FA921786-86E2-4647-9441-2E165BB9B6CC Content-Disposition: attachment; filename=0001-Fix-treesit-langauge-at-point-for-elixir-ts-mode.patch Content-Type: text/x-patch; x-unix-mode=0644; name="0001-Fix-treesit-langauge-at-point-for-elixir-ts-mode.patch" Content-Transfer-Encoding: quoted-printable =46rom 046950eb63b5499ab7f60434c5ebd0bbe5ada274 Mon Sep 17 00:00:00 2001 From: Wilhelm H Kirschbaum Date: Tue, 26 Sep 2023 21:32:40 +0200 Subject: [PATCH] Fix treesit-langauge-at-point for elixir-ts-mode. The treesit-language-at-point function is only suppose to query the host language. * lisp/progmodes/elixir-ts-mode.el (elixir-ts--indent-rules): Add missing rules. (elixir-ts--treesit-language-at-point): Update function to only query the host language. * test/lisp/progmodes/elixir-ts-mode-resources/indent.erts: Add test for inline docs. --- lisp/progmodes/elixir-ts-mode.el | 35 ++++++++++--------- .../elixir-ts-mode-resources/indent.erts | 16 +++++++++ 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/lisp/progmodes/elixir-ts-mode.el = b/lisp/progmodes/elixir-ts-mode.el index 7175fe4bff8..fd4400c6c53 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -312,7 +312,16 @@ elixir-ts--indent-rules ((parent-is "^catch_block$") parent ,offset) ((parent-is "^keywords$") parent-bol 0) ((node-is "^call$") parent-bol ,offset) - ((node-is "^comment$") parent-bol ,offset))))) + ((node-is "^comment$") parent-bol ,offset) + ((node-is "\"\"\"") parent-bol 0) + ;; Handle quoted_content indentation on the last + ;; line before the closing \"\"\", where it might + ;; see it as no-node outside a HEEx tag. + (no-node (lambda (_n _p _bol) + (treesit-node-start + (treesit-node-parent + (treesit-node-at (point) 'elixir)))) + 0))))) =20 (defvar elixir-ts--font-lock-settings (treesit-font-lock-rules @@ -510,21 +519,15 @@ elixir-ts--treesit-anchor-grand-parent-bol =20 (defun elixir-ts--treesit-language-at-point (point) "Return the language at POINT." - (let* ((range nil) - (language-in-range - (cl-loop - for parser in (treesit-parser-list) - do (setq range - (cl-loop - for range in (treesit-parser-included-ranges = parser) - if (and (>=3D point (car range)) (<=3D point (cdr = range))) - return parser)) - if range - return (treesit-parser-language parser)))) - (if (null language-in-range) - (when-let ((parser (car (treesit-parser-list)))) - (treesit-parser-language parser)) - language-in-range))) + (let ((node (treesit-node-at point 'elixir))) + (if (and (equal (treesit-node-type node) "quoted_content") + (let ((prev-sibling (treesit-node-prev-sibling node t))) + (when (treesit-node-p prev-sibling) + (string-match-p + (rx bos (or "H" "F") eos) + (treesit-node-text (treesit-node-prev-sibling node = t)))))) + 'heex + 'elixir))) =20 (defun elixir-ts--defun-p (node) "Return non-nil when NODE is a defun." diff --git a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts = b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts index 1f855d3c977..fe09a37a32b 100644 --- a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts @@ -330,6 +330,22 @@ Name: Long tuple "October", "November", "December"} =3D-=3D-=3D =20 +Name: Doc + +=3D-=3D +defmodule Foo do +""" + bar + """ +end +=3D-=3D +defmodule Foo do + """ + bar + """ +end +=3D-=3D-=3D + Name: Embedded HEEx =20 =3D-=3D --=20 2.42.0 --Apple-Mail=_FA921786-86E2-4647-9441-2E165BB9B6CC Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > > Wilhelm Thanks. I made some minor change and pushed to master. Yuan --Apple-Mail=_FA921786-86E2-4647-9441-2E165BB9B6CC-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 27 03:18:50 2023 Received: (at submit) by debbugs.gnu.org; 27 Sep 2023 07:18:50 +0000 Received: from localhost ([127.0.0.1]:50391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlOor-0005sl-QB for submit@debbugs.gnu.org; Wed, 27 Sep 2023 03:18:50 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlOoo-0005sH-Jx for submit@debbugs.gnu.org; Wed, 27 Sep 2023 03:18:46 -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 1qlOoU-00020S-D3 for bug-gnu-emacs@gnu.org; Wed, 27 Sep 2023 03:18:26 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qlOoT-0004tu-0o for bug-gnu-emacs@gnu.org; Wed, 27 Sep 2023 03:18:26 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-405505b07dfso50788505e9.0 for ; Wed, 27 Sep 2023 00:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695799103; x=1696403903; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=ToCGF0XzI994cXejTR8G5/Jbw23XEqL/rK0QPxWAzXY=; b=Kk3iE/fy5W43DQ1WzO89E8QutalAHIfr/OsNtVoL08yLNu6xa0k8SSpzJzQDzivddE ihMsvNoHOhP9UsT2srwoI4+vmOExXiv4JSV4o9lUQuqctBSqt0xJ2oylKrgxUxHXmxhd 3R9Pz5rg1AvGbwMrJCJxb7TlZH5hiQAiSqooUWHt/XsXGLbM6XBuQqYqCEYcZTJvlXV/ p7Mmf7bGtcVjtHRWkXpM0a9y6oVIterTjMk7PfLsPHMOihIM/AaUsQoPFv9IKTMuv2Nw 7M+DbnZPcgBC+S4yUL9QIEaoT8mv3J12j0GnKCANdG4sMAJG8XPX104K3ankgP9q/nEP DiJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695799103; x=1696403903; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ToCGF0XzI994cXejTR8G5/Jbw23XEqL/rK0QPxWAzXY=; b=QXILoCwYynjL/eeKzeEMZK4e3YgqjDJnSNAVL3+ppXrxkAgFfaClWFFMPYD/pBD+dn qlSmzU8stkSa54ThxLzvLXEpGk37QE+8iHvicxDu+xsuqpIRvyFnVzFHziqEP+G3ZpY7 36HDJ+0h/OG7FzM5j0O0270LMAexrjrpdL4kBuk35RtHHCm0pSeOnKR37w1lDQL+uG86 9PKirdfbg69aYQ0GF2Hwg5U9p/YeE6SpH7Mv41F/LlcI1XHOVfhT8hHSv9J+xHhs8SQx BSVADVw1ZLC9Var88ZcDfXsaMzhTlowBFuLAHxUPIPmlailXScokrarzER8DgCPAvKPJ ycSw== X-Gm-Message-State: AOJu0YyOzv1PUHBNuCynWBwtYqW63MtRn7Xv9Zy9BDlZr8Te9CeSgQ3g hceNXD+llg4YIp2WFvid1IFAOIpRgxvVUP4t X-Google-Smtp-Source: AGHT+IGH2Urla5Un2b8pc9Q4WWuClsF04l1CjdkoDEdFLVSP5HFXhVgMo2cy1Hmzto6xITwfl6pOag== X-Received: by 2002:a5d:5107:0:b0:31f:eb45:462e with SMTP id s7-20020a5d5107000000b0031feb45462emr884800wrt.28.1695799102879; Wed, 27 Sep 2023 00:18:22 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id o11-20020a5d4a8b000000b0031fc4c31d77sm16556291wrq.88.2023.09.27.00.18.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 00:18:22 -0700 (PDT) References: <87fs33wiki.fsf@pub.pink> <874jjg51mc.fsf@gmail.com> <87r0mky8iy.fsf@gmail.com> <9B77101A-02DA-4ED2-868C-A2D5AD353AA3@gmail.com> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Yuan Fu Subject: Re: bug#66183: elixir-ts-mode test failure Date: Wed, 27 Sep 2023 09:17:51 +0200 In-reply-to: <9B77101A-02DA-4ED2-868C-A2D5AD353AA3@gmail.com> Message-ID: <874jjgqe2t.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=wkirschbaum@gmail.com; helo=mail-wm1-x32a.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: Bug Report Emacs , john muhl , 66183-done@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: -0.0 (/) Yuan Fu writes: >> On Sep 26, 2023, at 1:26 PM, Wilhelm Kirschbaum=20 >> wrote: >>=20 >>>>> need to adjust it but the idea is there. >>>>> With the new language-at-point definition,=20 >>>>> treesit-language-at can >>>>> return the correct language, and the test passes again. >>>>> Yuan >>>>> [2. text/x-patch; example.diff]... >>>> This seems to work if you set named on:=20 >>>> treesit-node-prev-sibling, >>>> otherwise it just tries to match the \"\"\" against H or F. >>>> (let* ((node (treesit-node-at point 'elixir))) >>>> (if (and (equal (treesit-node-type node) "quoted_content") >>>> (string-match-p >>>> (rx bos (or "H" "F") eos) >>>> - (treesit-node-text (treesit-node-prev-sibling=20 >>>> node)))) >>>> + (treesit-node-text (treesit-node-prev-sibling=20 >>>> node t)))) >>>> 'heex >>>> 'elixir))) >>>> I will spend some time in the next couple of hours to catch=20 >>>> up to all >>>> the changes. >>>=20 >>> Ah, right. I=E2=80=99ll leave the specifics to you. As long as the=20 >>> language >>> is derived from the node at point rather than parser range, it=20 >>> will >>> be fine. Also, there=E2=80=99s no rush. >>>=20 >>=20 >> Hi Yuan, >>=20 >> With the new changes I had to update some indentation rules as=20 >> well. >> The following patch was tested against a couple of elixir=20 >> files. >>=20 >> There is another indentation issue with HEEx embeds, but think=20 >> its >> unrelated to this issue and will have a look this weekend. >>=20 > > [2. text/x-patch;=20 > 0001-Fix-treesit-langauge-at-point-for-elixir-ts-mode.patch]... > >>=20 >> Wilhelm > > Thanks. I made some minor change and pushed to master. > > Yuan Fantastic, thanks! From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 29 07:15:29 2023 Received: (at 66183) by debbugs.gnu.org; 29 Sep 2023 11:15:29 +0000 Received: from localhost ([127.0.0.1]:55422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmBSz-0008IM-9M for submit@debbugs.gnu.org; Fri, 29 Sep 2023 07:15:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmBSu-0008I3-9K for 66183@debbugs.gnu.org; Fri, 29 Sep 2023 07:15:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qmBSZ-0006IG-W1; Fri, 29 Sep 2023 07:15:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=3SRUR32MRvC/Y99OlApBx/dwmvDkxWFYXfL/fojGnBc=; b=aumZBszGizc/Kze/tpLe sGFxg/S80EUYLeyU4PZ+VQzgmpjJsV/BFehqHyEk9LCnIAVeLzuYayP2KknUF/K35t7Pke8nFPwL8 UuKtS8yf243ojOEHgl7kUwUxdPZeqxotCFSFh7+36mnuD0ztLpA2S73RJzuFcVu1Pyl/OYa0ndSjq 3214IlC9GVQdpX5YnhC5OMIXc9l/QW2KAQ5PSBgve6kOJpFGtK0sQ48lTCBMQJO6gYeIeUsajo7Cr r4YyfgA9VD7XHuIK/dzZXRrtX7zsq0UL2ocwaqfsOh+BBeOPG9CvrNipnvsRwIDGnAPQjmgDdsakh DGTyqN0i+3d7+g==; Date: Fri, 29 Sep 2023 14:14:44 +0300 Message-Id: <831qeh1ba3.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: (message from Yuan Fu on Tue, 26 Sep 2023 11:00:23 -0700) Subject: Re: bug#66183: elixir-ts-mode test failure References: <87fs33wiki.fsf@pub.pink> <874jjg51mc.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66183 Cc: wkirschbaum@gmail.com, 66183@debbugs.gnu.org, jm@pub.pink 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: -3.3 (---) > Cc: 66183@debbugs.gnu.org, jm@pub.pink > From: Yuan Fu > Date: Tue, 26 Sep 2023 11:00:23 -0700 > > > On Sep 26, 2023, at 9:30 AM, Wilhelm Kirschbaum wrote: > > > > > > Yuan Fu writes: > > > >>> On Sep 24, 2023, at 9:53 AM, john muhl via Bug reports for GNU > >>> Emacs, the Swiss army knife of text editors > >>> wrote: > >>> The change in 5cba5ee8905 caused an elixir test to start failing. The > >>> white space at the start of the test is now in a heex range so pressing > >>> tab there matches a heex rule instead of the elixir one. Moving the > >>> dummy range to the end fixes the test. > >> > >> Thank you. I’ll make sure to remember also running elixir tests when I make a change. > >> > >> I looked around and found elixir-mode’s language-at-point function > >> works in a way that isn’t what tree-sitter functions > >> expect. Tree-sitter functions expect the major mode to derive language > >> at point by querying the host language and do some pattern matching, > >> rather than using language parser’s range. I took a quick look at > >> elixir’s grammar and came up with this version for a POC. You probably > > > > Sorry about that. I had absolutely no idea how it was expected to work. > > It’s absolutely my fault :-) Several people have had confusion about it, because the docstring wasn’t clear enough. I’ve updated the docstring so hopefully this confusion won’t occur in the future. Should this doc-string fix be cherry-picked to the release branch? From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 05 03:18:20 2023 Received: (at 66183) by debbugs.gnu.org; 5 Oct 2023 07:18:20 +0000 Received: from localhost ([127.0.0.1]:45900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoIcm-0004vC-8f for submit@debbugs.gnu.org; Thu, 05 Oct 2023 03:18:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoIck-0004uz-FZ for 66183@debbugs.gnu.org; Thu, 05 Oct 2023 03:18:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoIcM-00047b-5t; Thu, 05 Oct 2023 03:17:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=fojSL1Caadxci5svdm0XJCyHJsnUaSaK9E8v46AES6w=; b=GS+NpGjGa5zcDUzMj0I8 rveIgBnHkPzBlwbHhtzLLJLntlCVIbqmQUS8XcWMcsmHWYu4yQQ9B2ZGsLmu4L7Y1MQ4moJIixGvJ V1hQYy8Xq7yzkLzc5kAQRtERuU8gyJL0qk/JXSbD2nUUw4KyDLwBYjw+YRSiUEXDCVSAzxo8y8Y2z hz4gx39qCpMAFh5o3Tc8LZts4FGi6+zYh8/lkmu2fsfDZwtxaQYbE+df8rujLNqWFMy0+iO6Qz6i8 iU1p5fvhAYWFvWDtRBLT3SkdtdsvAUGLcoUS1edoW26h/OnNO9iCP3kGo8YwACZ7KHvZVIADAEIiX z8OzK0Al3t5V4g==; Date: Thu, 05 Oct 2023 10:18:01 +0300 Message-Id: <83jzs14jx2.fsf@gnu.org> From: Eli Zaretskii To: casouri@gmail.com In-Reply-To: <831qeh1ba3.fsf@gnu.org> (message from Eli Zaretskii on Fri, 29 Sep 2023 14:14:44 +0300) Subject: Re: bug#66183: elixir-ts-mode test failure References: <87fs33wiki.fsf@pub.pink> <874jjg51mc.fsf@gmail.com> <831qeh1ba3.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66183 Cc: wkirschbaum@gmail.com, 66183@debbugs.gnu.org, jm@pub.pink 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: -3.3 (---) Ping! > Cc: wkirschbaum@gmail.com, 66183@debbugs.gnu.org, jm@pub.pink > Date: Fri, 29 Sep 2023 14:14:44 +0300 > From: Eli Zaretskii > > > Cc: 66183@debbugs.gnu.org, jm@pub.pink > > From: Yuan Fu > > Date: Tue, 26 Sep 2023 11:00:23 -0700 > > > > > On Sep 26, 2023, at 9:30 AM, Wilhelm Kirschbaum wrote: > > > > > > > > > Yuan Fu writes: > > > > > >>> On Sep 24, 2023, at 9:53 AM, john muhl via Bug reports for GNU > > >>> Emacs, the Swiss army knife of text editors > > >>> wrote: > > >>> The change in 5cba5ee8905 caused an elixir test to start failing. The > > >>> white space at the start of the test is now in a heex range so pressing > > >>> tab there matches a heex rule instead of the elixir one. Moving the > > >>> dummy range to the end fixes the test. > > >> > > >> Thank you. I’ll make sure to remember also running elixir tests when I make a change. > > >> > > >> I looked around and found elixir-mode’s language-at-point function > > >> works in a way that isn’t what tree-sitter functions > > >> expect. Tree-sitter functions expect the major mode to derive language > > >> at point by querying the host language and do some pattern matching, > > >> rather than using language parser’s range. I took a quick look at > > >> elixir’s grammar and came up with this version for a POC. You probably > > > > > > Sorry about that. I had absolutely no idea how it was expected to work. > > > > It’s absolutely my fault :-) Several people have had confusion about it, because the docstring wasn’t clear enough. I’ve updated the docstring so hopefully this confusion won’t occur in the future. > > Should this doc-string fix be cherry-picked to the release branch? > > > > From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 04:46:59 2023 Received: (at 66183) by debbugs.gnu.org; 7 Oct 2023 08:46:59 +0000 Received: from localhost ([127.0.0.1]:53291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp2xf-0006Fk-Bg for submit@debbugs.gnu.org; Sat, 07 Oct 2023 04:46:59 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:53281) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp2xd-0006FV-Ic for 66183@debbugs.gnu.org; Sat, 07 Oct 2023 04:46:58 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-406402933edso26156355e9.2 for <66183@debbugs.gnu.org>; Sat, 07 Oct 2023 01:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696668392; x=1697273192; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=6WhjtvsrqBDS87NLbv/fPGnGG8UpjM5eKc4Aum/O/Ow=; b=h6WeBDzE5nMxThuNCpcKfsOw+5MPODp6/YBlJ1nfGShB3lEWXNyJgh9NRgkdIiOepb zW4k1oAi3DYGTLrhCCJcG2PzjSPoQFGjFs3f4mbSsPRm2R6JSVxtiUtS60EZunYeFc10 r8l0CEASFtHkrSuXbl2KrcFICi6wVU61U9zQxMEGmx92GJaSdZs9iya3zkuKFeTRrdsK o0CDqQxNrlssuB3ywub/maW187Uku21Dyyj2iyOjb8B4ebplbiKLrSuFmpCvQlpgilCe vhd3Ss3FX5+NWQcSLDMwzKzH1tJtDRJJeZCZ+hqjLLtHS0aJuAuG7o2i1v4bzBDA88vd wUWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696668392; x=1697273192; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=6WhjtvsrqBDS87NLbv/fPGnGG8UpjM5eKc4Aum/O/Ow=; b=jkX5v6zHU2G5jjNAEPv/ZMQklPv6AVmvVgoTrtAikKM3Kg88A3BViVLcjL5irwpP9R O6g1ajM4PpKmcHQg5ovu1IjEVcNhPB3/M3YGgjA7YIEkRSnVmfwiPax6gn7F5qReJIqx XlziUFXz8CgrvFxuKDaFyJThsZ1y2ETn0dY4UvxPa7aAm+mQSgX4XgQflntjpf+eSsai q+zqCKRqdjCvtPgEPXEG721HiWZSsI7Y22Dodss5Gx2cZzwRZtZVDfNc0qoke1RjnvRu poznJEV6iUKbfEaT7OS5FSOsGYtUFSUcaYZRWZNDVCqCrQxyVoWJnMj+j7BbjbDO81i+ zfaw== X-Gm-Message-State: AOJu0YxX9alom+bxSKic6Wi7vID/SIlIJuN7CnvvK34LaIcR61oudHrH OvJKjChmrZ3HzyZkB8EmAvI= X-Google-Smtp-Source: AGHT+IEu8GS7poX+vl7D7TPKZn7UIBW0yCXxbKRqULFpEGCpISDt8O9OaiObhCyODEF2R7WPQ0cTMQ== X-Received: by 2002:a7b:ce85:0:b0:405:4a78:a890 with SMTP id q5-20020a7bce85000000b004054a78a890mr9111099wmj.8.1696668392386; Sat, 07 Oct 2023 01:46:32 -0700 (PDT) Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id q15-20020a7bce8f000000b00405391f485fsm5564689wmj.41.2023.10.07.01.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 01:46:32 -0700 (PDT) References: <87fs33wiki.fsf@pub.pink> <874jjg51mc.fsf@gmail.com> <831qeh1ba3.fsf@gnu.org> <83jzs14jx2.fsf@gnu.org> User-agent: mu4e 1.9.3; emacs 30.0.50 From: Wilhelm Kirschbaum To: Eli Zaretskii Subject: Re: bug#66183: elixir-ts-mode test failure Date: Sat, 07 Oct 2023 10:44:12 +0200 In-reply-to: <83jzs14jx2.fsf@gnu.org> Message-ID: <87il7irfa3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66183 Cc: 66183@debbugs.gnu.org, casouri@gmail.com, jm@pub.pink 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 (-) >> > It=E2=80=99s absolutely my fault :-) Several people have had=20 >> > confusion >> > about it, because the docstring wasn=E2=80=99t clear enough. I=E2=80= =99ve=20 >> > updated >> > the docstring so hopefully this confusion won=E2=80=99t occur in the >> > future. >>=20 >> Should this doc-string fix be cherry-picked to the release=20 >> branch? >>=20 I don't see why not, because the elixir-ts-mode patch works on=20 29.1 as well.=20 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 05:05:18 2023 Received: (at 66183) by debbugs.gnu.org; 7 Oct 2023 09:05:18 +0000 Received: from localhost ([127.0.0.1]:53308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp3FO-0006nW-Do for submit@debbugs.gnu.org; Sat, 07 Oct 2023 05:05:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp3FL-0006nG-7P for 66183@debbugs.gnu.org; Sat, 07 Oct 2023 05:05:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qp3Ew-0003Oc-5l; Sat, 07 Oct 2023 05:04:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=6pJqH7nQOKNUr2SsGZ89WYpD0lObOiTXn+Kx5YE1XjY=; b=JvL6UuOkgszNgBg+fJVD NL1S6VdvzOIWoe2k664OjFdLj+L9OEDSMZwQwPtepcQJqdG0sWJA4NzDsYadnxUYwnbR5vuEDIU/w 6fTggzkOwVL42Ga5binZ0KehIy89YTo3yMBWdfnJrQEmjkpAAji7BfLcFzpuQDLdkjQGyD+mA5pFH fhXKS+I0WhYVluP6HC/dw593xYxV9++29pxTcYEj/1N0QzO9RXAbFIk7NNfONOnR/Hq26mXI56K3l SGf2eYzVlpXlF83r9uFWPUoTnOoE4RV21S1yoK/eqov0rqzBjhLp6vkoR5LigiL8jqAOPw5mMlx0U hhwDh/M9aeXGoA==; Date: Sat, 07 Oct 2023 12:05:01 +0300 Message-Id: <837cny2476.fsf@gnu.org> From: Eli Zaretskii To: Wilhelm Kirschbaum In-Reply-To: <87il7irfa3.fsf@gmail.com> (message from Wilhelm Kirschbaum on Sat, 07 Oct 2023 10:44:12 +0200) Subject: Re: bug#66183: elixir-ts-mode test failure References: <87fs33wiki.fsf@pub.pink> <874jjg51mc.fsf@gmail.com> <831qeh1ba3.fsf@gnu.org> <83jzs14jx2.fsf@gnu.org> <87il7irfa3.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66183 Cc: 66183@debbugs.gnu.org, casouri@gmail.com, jm@pub.pink 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: -3.3 (---) > From: Wilhelm Kirschbaum > Cc: casouri@gmail.com, 66183@debbugs.gnu.org, jm@pub.pink > Date: Sat, 07 Oct 2023 10:44:12 +0200 > > > > >> > It’s absolutely my fault :-) Several people have had > >> > confusion > >> > about it, because the docstring wasn’t clear enough. I’ve > >> > updated > >> > the docstring so hopefully this confusion won’t occur in the > >> > future. > >> > >> Should this doc-string fix be cherry-picked to the release > >> branch? > >> > > I don't see why not, because the elixir-ts-mode patch works on > 29.1 as well. Done. From unknown Tue Jun 17 20:32:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 04 Nov 2023 11:24:05 +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