GNU bug report logs -
#66183
elixir-ts-mode test failure
Previous Next
Reported by: john muhl <jm <at> pub.pink>
Date: Sun, 24 Sep 2023 18:09:02 UTC
Severity: normal
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Tue, 26 Sep 2023 23:46:13 -0700
with message-id <9B77101A-02DA-4ED2-868C-A2D5AD353AA3 <at> gmail.com>
and subject line Re: bug#66183: elixir-ts-mode test failure
has caused the debbugs.gnu.org bug report #66183,
regarding elixir-ts-mode test failure
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
66183: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66183
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 ‘t’)
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
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/lisp/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
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
> On Sep 26, 2023, at 1:26 PM, Wilhelm Kirschbaum <wkirschbaum <at> gmail.com> wrote:
>
>>>> 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.
>>
>> Ah, right. I’ll 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’s no rush.
>>
>
> Hi Yuan,
>
> With the new changes I had to update some indentation rules as 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.
>
[0001-Fix-treesit-langauge-at-point-for-elixir-ts-mode.patch (text/x-patch, attachment)]
[Message part 6 (text/plain, inline)]
>
> Wilhelm
Thanks. I made some minor change and pushed to master.
Yuan
This bug report was last modified 1 year and 283 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.