[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 63d69bd1549 07/11: Use new baseline indent rule in c-ts-mode
From: |
Andrea Corallo |
Subject: |
Re: master 63d69bd1549 07/11: Use new baseline indent rule in c-ts-mode |
Date: |
Tue, 03 Dec 2024 03:05:25 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Yuan Fu <casouri@gmail.com> writes:
>> On Dec 2, 2024, at 1:02 PM, Andrea Corallo <acorallo@gnu.org> wrote:
>>
>> Yuan Fu <casouri@gmail.com> writes:
>>
>>> branch: master
>>> commit 63d69bd154987bcc0434e0f85e09bf5dfa07b827
>>> Author: Yuan Fu <casouri@gmail.com>
>>> Commit: Yuan Fu <casouri@gmail.com>
>>>
>>> Use new baseline indent rule in c-ts-mode
>>>
>>> Rework the indent rules in c-ts-mode using
>>> c-ts-common-baseline-indent-rule. Also reworked internal
>>> functions for setting indent styles to make it simpler and (more
>>> importantly) more readable. Now there's a single function,
>>> c-ts-mode--simple-indent-rules, that returns a value that can go
>>> straight to treesit-simple-indent-rules.
>>>
>>> * lisp/progmodes/c-ts-mode.el:
>>> (c-ts-mode--indent-style-setter): Simplify.
>>> (c-ts-mode--get-indent-style): Remove function.
>>> (c-ts-mode--prompt-for-style): Use a hard-coded list of styles.
>>> This is a tiny downgrade from the computed lists but is
>>> acceptable.
>>> (c-ts-mode-set-style): Use c-ts-mode--simple-indent-rules.
>>> (c-ts-mode--standalone-grandparent): Docstring change.
>>> (c-ts-mode--for-loop-indent-rule): New function.
>>> (c-ts-mode--preproc-indent-rules): New variable. Copied from
>>> old indent rules and added some new rule.
>>> (c-ts-mode--macro-heuristic-rules):
>>> (c-ts-mode--simple-indent-rules):
>>> (c-ts-mode--parenthesized-expression-indent-rule):
>>> (c-ts-mode--label-indent-rules): New functions.
>>> (c-ts-mode):
>>> (c++-ts-mode): Use c-ts-mode--simple-indent-rules.
>>> ---
>>
>> Hi Yuan,
>>
>> this commit on my test-bench seems to introduce on master the following
>> two failures: c-ts-mode-test-indentation-bsd,
>> c-ts-mode-test-indentation.
>>
>> Could you have a look?
>>
>> Andrea
>
> Hey Andrea, sorry about that. The tests do pass on my machine. How does the
> test-bench run the tests?
>
> Yuan
Seems 44fcd37a486399be048fb03b9456497af78632fe fixed
c-ts-mode-test-indentation-bsd. I still see:
Running 4 tests (2024-12-03 03:51:05+0100, selector `(not (or (tag
:expensive-test) (tag :unstable) (tag :nativecomp)))')
passed 1/4 c-ts-mode-test-filling (0.033575 sec)
Test c-ts-mode-test-indentation backtrace:
signal(ert-test-failed (("Mismatch in test \"For Loop with Multi-lin
ert-fail(("Mismatch in test \"For Loop with Multi-line Condition (GN
ert-test--erts-test(((code lambda nil (c-ts-mode) (setq-local indent
ert-test-erts-file("/home/andcor03/emacs-ci/emacs-ci-repo1/test/lisp
#f(compiled-function () #<bytecode 0x165c3552b49c3535>)()
#f(compiled-function () #<bytecode -0x1132e651e2fb7509>)()
handler-bind-1(#f(compiled-function () #<bytecode -0x1132e651e2fb750
ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
ert-run-test(#s(ert-test :name c-ts-mode-test-indentation :documenta
ert-run-or-rerun-test(#s(ert--stats :selector (not (or ... ... ...))
ert-run-tests((not (or (tag :expensive-test) (tag :unstable) (tag :n
ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable) (
ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) (
command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-l
command-line()
normal-top-level()
Test c-ts-mode-test-indentation condition:
(ert-test-failed
("Mismatch in test \"For Loop with Multi-line Condition (GNU Style)\",
file
/home/andcor03/emacs-ci/emacs-ci-repo1/test/lisp/progmodes/c-ts-mode-resources/indent.erts"
#("int main()\n{\n for (\n int i = 0;\n i < b;\n i++\n
)\n {\n return 0;\n }\n}\n"
0 108 (fontified nil))
"int main()\n{\n for (\n int i = 0;\n i < b;\n i++\n
)\n {\n return 0;\n }\n}\n"))
FAILED 2/4 c-ts-mode-test-indentation (0.016936 sec) at
lisp/progmodes/c-ts-mode-tests.el:26
Configuring with --with-native-compilation=no --with-x-toolkit=no
Regards
Andrea