GNU bug report logs -
#67036
30.0.50; treesit-forward-sexp not working properly in ruby-ts-mode
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Fri, 10 Nov 2023 07:53:02 UTC
Severity: normal
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #32 received at 67036 <at> debbugs.gnu.org (full text, mbox):
close 67036 30.0.50
thanks
>>>>>>>>> +# C-M-f on '[' doesn't jump to after ']'
>>>>>>>>> +hash['key']
>>>>>>>>> +
>>>>>>>
>>>>>>> As discussed previously, there is no specific node which spans from [ to
>>>>>>> ]. Some custom code could probably be written (there *are* leaf nodes for [
>>>>>>> and ]), but the current capabilities of treesit-thing-settings don't offer
>>>>>>> a good way to plug that in.
>>>>>> Like for point inside strings, this might require more general changes
>>>>>> that take into account syntax tables.
>>>>>
>>>>> Possibly, but I expect a solution that doesn't use the syntax table would
>>>>> be tried first.
>>>> Since there is no available information from treesit, handling
>>>> treesit-forward-sexp inside strings/comments could forward to the syntax table
>>>> like `prog-fill-reindent-defun' forwards to `fill-paragraph'.
>>
>> Shouldn't treesit-forward-sexp provide a way for ts-modes to override
>> the default handling? By default for all ts-modes such a hook could
>> check if point is inside strings/comments then to use syntax navigation.
>
> This is now implemented in bug#68993. So here is the patch that
> handles such cases as C-M-f jumping from '[' to ']' in
>
> hash[:key]
> hash['key']
>
> and from '{' to '}' in
>
> "abc #{ghi} def"
>
> diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el
I guess this patch was ok. So I pushed it to master, and closed.
Anything could be adjusted later if needed.
This bug report was last modified 1 year and 22 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.