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


Message #23 received at 62416 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Boško Ivanišević <bosko.ivanisevic <at> gmail.com>,
 62416 <at> debbugs.gnu.org
Subject: Re: bug#62416: 30.0.50; Symbols skipped in the navigation in
 ruby-ts-mode
Date: Tue, 28 Mar 2023 09:31:52 +0300
>> This will break other cases, e.g.
>>    b = %Q{This is a "string"}
>>    c = %w!foo
>>     bar
>>     baz!
>>    d = %(hello (nested) world)
>> when point is after "b", 'C-M-f' will move to "c" instead of the end of
>> line.
>
> That is because the string literals aren't recognized as sexps yet. Try
> this:
>
> @@ -1129,8 +1129,11 @@ ruby-ts-mode
>                              "block"
>                              "do_block"
>                              "begin"
> -                            "binary"
> -                            "assignment")))
> +                            "integer"
> +                            "simple_symbol"
> +                            "string"
> +                            "string_array"
> +                            )))

Thanks, this definitely is an improvement since it handles all mentioned cases.

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.

Looking at test/lisp/progmodes/ruby-mode-resources/ruby.rb
for example here curly brackets are not matched with 'C-M-f C-M-b'
in string interpolation and regexps:

  "abc/#{ddf}ghi"

  /foo/xi != %r{bar}mo.tee

Do you think it is possible to handle these cases
by crafting treesit-sexp-type-regexp?




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.