GNU bug report logs - #62416
30.0.50; Symbols skipped in the navigation in ruby-ts-mode

Previous Next

Package: emacs;

Reported by: Boško Ivanišević <bosko.ivanisevic <at> gmail.com>

Date: Fri, 24 Mar 2023 12:38:02 UTC

Severity: normal

Found in version 30.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Yuan Fu <casouri <at> gmail.com>
Cc: bosko.ivanisevic <at> gmail.com, 62416 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: bug#62416: 30.0.50; Symbols skipped in the navigation in ruby-ts-mode
Date: Mon, 3 Apr 2023 01:43:40 +0300
On 03/04/2023 01:34, Yuan Fu wrote:
> 
>> On Mar 30, 2023, at 2:32 AM, Dmitry Gutov<dgutov <at> yandex.ru>  wrote:
>>
>> On 30/03/2023 10:47, Yuan Fu wrote:
>>
>>>> However, there are still a lot of more things that need fixing.
>>>> When point is on the left curly bracket in
>>>>
>>>>    b = %Q{This is a "string"}
>>>>
>>>> 'C-M-f' doesn't move to the right curly bracket.
>>>> Also double quotes inside the string are not matched by 'C-M-f'.
>>>>
>>>> In
>>>>
>>>>    d = %(hello (nested) world)
>>>>
>>>> 'C-M-f' doesn't move to the closing parens from opening parens.
>>> Have someone fixed these two cases? Because when I tried to invoke
>>> (treesit-forward-sexp), point moved to the closing bracket/paren.
>>  From which position? When point is right before '{', it doesn't move in my testing. It does move when it was before '%'.
> Ok, I see it. I’ll try to see what’s going on when I find some time.

There is nothing surprising in this behavior, given the current 
implementation: it doesn't examine the text in the buffer, just uses the 
parse tree,

And there is no trace of these parens/braces in the parse tree.

>>> Anyway, I just wonder if there’s any fundamental shortcoming with how
>>> treesit-beginning/end-of-thing works?
>> I don't know. Seems like this method is good for a lot of things, but some fiddly details are going to be different from the default forward-sexp.
>>
>> ruby-mode's sexp navigation is also not ideal in its own way, and it's been useful anyway.
> One thing I noticed is that treesit-forward-sexp uses treesit-beginning/end-of-thing, which jumps out of the parent when there is no more siblings to go to. The default forward-sexp obviously doesn’t do this. Perhaps we should stay in the same level in tree-sitter-forward-sexp too.

That's a different aspect of its behavior. One that makes 
'backward-up-list' fail to work, IIUC.




This bug report was last modified 2 years and 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.