[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests
From: |
Yuan Fu |
Subject: |
Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests |
Date: |
Tue, 10 Dec 2024 22:15:32 -0800 |
> On Dec 6, 2024, at 11:49 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Fri, 6 Dec 2024 17:04:42 -0800
>> Cc: Emacs Devel <emacs-devel@gnu.org>,
>> Andrea Corallo <acorallo@gnu.org>
>>
>>
>>
>>> On Dec 5, 2024, at 11:30 PM, Yuan Fu <casouri@gmail.com> wrote:
>>>
>>>
>>>
>>>> On Dec 4, 2024, at 11:37 PM, Michael Albinus <michael.albinus@gmx.de>
>>>> wrote:
>>>>
>>>> Yuan Fu <casouri@gmail.com> writes:
>>>>
>>>> Hi Yuan,
>>>>
>>>>> This is baffling. I assume the pipeline build the latest
>>>>> tree-sitter-c/cpp grammar right? I just updated my grammar and
>>>>> tree-sitter lib to the latest and the tests still pass on my
>>>>> machine. Is tree-sitter version also the latest?
>>>>
>>>> See test/infra/Dockerfile.emba. The emacs-tree-sitter container image is
>>>> created prior every run, the treesitter grammars mentioned there are
>>>> installed.
>>>
>>> Ah, so the image uses Debian bookworm, which AFAIK is the current stable
>>> release, so it probably doesn’t have the latest tree-sitter library. Let me
>>> try to run the pipeline with tree-sitter built from upstream.
>>>
>>> Yuan
>>
>> I didn’t run the pipeline built from upstream, but I tried running the tests
>> locally with the tree-sitter library used in the pipeline. The pipeline uses
>> tree-sitter provided by bookworm, which is v0.20.7, a pretty old version.
>> And indeed, with that version of tree-sitter I can see the test failure.
>>
>> Andrea, which version of tree-sitter do you have on your test bench?
>>
>> Since tree-sitter is still relatively unstable, maybe we want to use
>> upstream tree-sitter for the test suite?
>
> I don't think this is practical. I'd rather mark that test as
> expected failure or "unstable", if we cannot know the version of the
> tree-sitter library used for the test.
>
> Or maybe you could rewrite the test so that it works in both old and
> new versions of the library.
>
> (FWIW, I use 0.20.8, with the latest grammar libraries, and the test
> fails here as well. Due to the issues with ABI breakage in the
> tree-sitter library, I decided that I will upgrade only when 0.25 is
> released, because it also bumps the language ABI version, which we can
> detect in Emacs.)
I dug into it, and the culprit is a bug in older tree-sitter versions where
(the C equivalent of) treesit-node-field-name-for-child gives the wrong field
name. I rewrote the indent function so it uses child node index instead of
field name to match indentation rules. Now the tests should pass.
Yuan
- Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests, Michael Albinus, 2024/12/04
- Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests, Yuan Fu, 2024/12/05
- Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests, Michael Albinus, 2024/12/05
- Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests, Yuan Fu, 2024/12/06
- Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests, Yuan Fu, 2024/12/06
- Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests, Eli Zaretskii, 2024/12/07
- Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests,
Yuan Fu <=
- Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests, Andrea Corallo, 2024/12/11
- Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests, Andrea Corallo, 2024/12/11
- Re: master 44fcd37a486 08/11: Add more c-ts-mode indent tests, Yuan Fu, 2024/12/12