Yuan Fu
f63bcf2dfe
Fix treesit--indent-1 regarding local parsers
...
Take this code as an example:
1 class Foo
2 {
3 /**
4 * Block comment
5 */
6 function foo($c) {
7 }
8 }
Suppose the block comment is covered by a local parser. When we
indent line 3, treesit--indent-1 will try to get the local parser at
the BOL, and it'll get the local parser. But it shouldn't use the
local parser to indent this line, it should use the host parser of
that local parser instead.
So now, if treesit--indent-1 gets a local parser, but the local
parser's root node's start coincides with BOL, treesit--indent-1 will
use the host parser to indent this line.
We also need to make treesit--update-ranges-local to save the host
parser along with the local parser, and make
treesit-local-parsers-at/on extract and return the host parser.
I also switch the two cases in the cond form in treesit--indent-1:
(null (treesit-parser-list)) and (car local-parsers), (car
local-parsers) now takes precedence.
* lisp/treesit.el (treesit-local-parsers-at):
(treesit-local-parsers-on): Add WITH-HOST parameter.
(treesit--update-ranges-local): Save the host parser to the local
overlay.
(treesit--indent-1): If the root node of the local parser is at BOL,
use the host parser instead.
2024-01-30 22:28:47 -08:00
..
2024-01-27 16:42:47 +02:00
2024-01-21 14:09:34 +01:00
2024-01-02 10:28:14 +08:00
2024-01-30 17:23:25 -08:00
2024-01-21 14:09:34 +01:00
2024-01-24 20:58:32 -08:00
2024-01-29 17:33:35 -08:00
2024-01-21 14:09:34 +01:00
2024-01-27 20:44:01 +02:00
2024-01-27 15:51:39 +02:00
2024-01-02 10:28:14 +08:00
2024-01-29 00:22:37 -08:00
2024-01-27 08:13:22 -05:00
2024-01-16 14:22:39 +02:00
2024-01-29 00:22:37 -08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 15:28:06 +01:00
2024-01-21 14:09:34 +01:00
2024-01-30 17:23:25 -08:00
2024-01-21 15:28:06 +01:00
2024-01-27 15:05:40 +02:00
2024-01-04 18:44:43 -05:00
2024-01-13 05:36:15 -05:00
2024-01-29 15:45:47 +08:00
2024-01-20 06:25:59 -05:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 09:47:10 +08:00
2024-01-27 12:30:55 +02:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-04 18:44:43 -05:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-04 18:44:43 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-24 12:57:33 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-13 05:36:16 -05:00
2024-01-02 09:47:10 +08:00
2024-01-27 19:11:22 +02:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 09:47:10 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 10:28:14 +08:00
2024-01-25 19:38:03 +02:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-20 11:40:22 +02:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-07 12:39:47 +01:00
2024-01-10 23:07:09 +01:00
2024-01-21 15:28:06 +01:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 15:28:06 +01:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-10 16:24:53 +01:00
2024-01-02 09:47:10 +08:00
2024-01-15 19:00:50 -05:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-06 08:20:19 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-09 19:57:50 +02:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:30:05 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-15 16:55:27 +01:00
2024-01-27 12:18:17 +02:00
2024-01-02 09:47:10 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-21 15:28:06 +01:00
2024-01-02 09:47:10 +08:00
2024-01-20 15:03:05 -05:00
2024-01-02 10:28:14 +08:00
2024-01-18 05:17:44 -05:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 10:28:14 +08:00
2024-01-10 22:16:24 +01:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-27 10:38:14 +02:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-29 21:21:50 +02:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-28 18:51:11 -05:00
2024-01-02 09:47:10 +08:00
2024-01-27 08:14:31 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-11 09:11:18 +02:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-04 22:04:29 +01:00
2024-01-02 10:28:14 +08:00
2024-01-04 18:44:43 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-27 12:52:55 +02:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-25 19:52:08 +02:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-04 22:12:14 -05:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-09 19:22:40 +02:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-20 06:25:59 -05:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-11 12:49:27 +02:00
2024-01-02 10:28:14 +08:00
2024-01-21 15:28:06 +01:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-30 22:28:47 -08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-27 19:18:16 +02:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 14:09:34 +01:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-21 14:09:34 +01:00
2024-01-20 06:25:59 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-28 18:51:11 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00