bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#77906: 31.0.50; php-js-mode and js-ts-mode: treesit-show-paren-data-


From: Juri Linkov
Subject: bug#77906: 31.0.50; php-js-mode and js-ts-mode: treesit-show-paren-data--categorize: peculiar error: ("Cannot find the definition of the predicate in `treesit-thing-settings'" list)
Date: Thu, 24 Apr 2025 09:47:08 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)

>>  @@ -869,7 +869,7 @@ treesit-parsers-at
>>     (let ((res nil))
>>       ;; Refer to (ref:local-parser-overlay) for more explanation of local
>>       ;; parser overlays.
>>  -    (dolist (ov (overlays-at (or pos (point))))
>>  +    (dolist (ov (overlays-at (1- (or pos (point)))))
>>         (when-let* ((parser (overlay-get ov 'treesit-parser))
>>                     (host-parser (or (null with-host)
>>                                      (overlay-get ov 'treesit-host-parser)))
>> 
>> With this patch the following case works correctly in test.heex:
>> 
>>  <%= if true do %>
>>    <p>hello, tree-sitter!</p>
>>  <% end| %>
>> 
>> With point at "|" the command 'backward-sexp' (C-M-b)
>> correctly jumps to the beginning of "if".
>
> Right.  I think it can be done in backward-sexp since there we know
> we’re moving back.  I assume that’s what you mean.

The problem is that the last time when the arg is still -1
is in 'treesit-forward-sexp', and then it calls
'treesit-beginning-of-thing' with '(abs arg)'.

The complete call chain:

- treesit-forward-sexp
- treesit-beginning-of-thing
- treesit-navigate-thing
- treesit-thing-at
- treesit-node-at
- treesit-parsers-at
- overlays-at

So not clear how to propagate the flag for decrementing the offset.
Maybe by let-binding a new dynamically bound variable?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]