GNU bug report logs - #67036
30.0.50; treesit-forward-sexp not working properly in ruby-ts-mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Juri Linkov <juri@HIDDEN>; dated Fri, 10 Nov 2023 07:53:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 67036 <at> debbugs.gnu.org:


Received: (at 67036) by debbugs.gnu.org; 25 Nov 2023 09:25:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 04:25:49 2023
Received: from localhost ([127.0.0.1]:37803 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r6ov7-0000z7-6t
	for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 04:25:49 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:42602)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1r6ov5-0000yu-8s
 for 67036 <at> debbugs.gnu.org; Sat, 25 Nov 2023 04:25:47 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1r6ouu-0007K9-E8; Sat, 25 Nov 2023 04:25:36 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=1ghtlGUtdILmoWWSHc9Fyxar9+OgZdXtT9+/ROlmBP4=; b=miwmiKNZvYXz
 CAnab07x+cykAY36EV+0ICczfA4H1wH6QfOySyeXycOlV2Pt9b975X9Gy1f0hC8H1p6HUDSDxty/X
 iHTmKd5PFbHfwKHxxwenfubWo6YtELc7ijKvfvzOLmNjX++toL2ZU8OX06MqSWO0qq9bPJnzIc+Y5
 o7GFXvKuMrKO9upQsrr7g9iGMIzwjiO0p1v7dYcCMv3yJHGkLrH0LiQYK8qKRAluNrfNa1TS7Q6nk
 EtsMa2hgWGhDU+xwONaCZ7ma+EpIPj6LGHmkjJfc5EBX0vR1JN0OIuVAregPsOnIKAN4YqSg1f7W4
 REntS6WZzZZ5Ec+UV/SPLg==;
Date: Sat, 25 Nov 2023 11:25:06 +0200
Message-Id: <83a5r2dw25.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>, Yuan Fu <casouri@HIDDEN>,
 dmitry@HIDDEN
In-Reply-To: <86bkc2nktq.fsf@HIDDEN> (message from Juri Linkov on
 Fri, 10 Nov 2023 09:42:17 +0200)
Subject: Re: bug#67036: 30.0.50;
 treesit-forward-sexp not working properly in ruby-ts-mode
References: <86bkc2nktq.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67036
Cc: 67036 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ping!  Yuan and Dmitry, can we please make some progress here?

> Cc: dmitry@HIDDEN
> From: Juri Linkov <juri@HIDDEN>
> Date: Fri, 10 Nov 2023 09:42:17 +0200
> 
> Please try these 5 cases described in the comments of this diff:
> 
> diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby.rb b/test/lisp/progmodes/ruby-mode-resources/ruby.rb
> index 81d0dfd75c9..abe6a0789b9 100644
> --- a/test/lisp/progmodes/ruby-mode-resources/ruby.rb
> +++ b/test/lisp/progmodes/ruby-mode-resources/ruby.rb
> @@ -123,6 +123,7 @@ def test2 (arg)
>      puts "there"
>    end
>  
> +  # from "elsif" and "then" C-M-f should jump to next "elsif"/"else" like with { }
>    if a == 2 then
>      puts "hello"
>    elsif a == 3
> @@ -179,6 +180,7 @@ def test2 (arg)
>      bar,
>      :a
>  
> +# when point is after @, C-M-f should jump to the end of symbol
>  zzz @abc,
>      4
>  
> @@ -211,10 +213,16 @@ def test2 (arg)
>  
>  class C
>    def foo
> -    self.end
> +    self.end # when point between 'e' and 'n', C-M-b should jump to "self"
>      D.new.class
>    end
>  
> +  class << self
> +    def bar
> +    end
> +  end
> +  # C-M-b at the end of "end" should jump to "class"
> +
>    def begin
>    end
>  end
> @@ -522,6 +530,9 @@ def qux
>    puts "Japanese translation: #{orig_text} => #{trans_text}"
>  end
>  
> +# C-M-f on '[' doesn't jump to after ']'
> +hash['key']
> +
>  # Tokenizing "**" and "|" separately.
>  def resolve(**args)
>    members = proc do |**args|
> 
> Is it possible to improve ruby-ts-mode to handle these cases?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67036; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 Nov 2023 07:52:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 10 02:52:05 2023
Received: from localhost ([127.0.0.1]:49461 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r1MJA-0000KF-Vu
	for submit <at> debbugs.gnu.org; Fri, 10 Nov 2023 02:52:05 -0500
Received: from lists.gnu.org ([2001:470:142::17]:40432)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1r1MJ5-0000JB-C9
 for submit <at> debbugs.gnu.org; Fri, 10 Nov 2023 02:52:00 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1r1MIL-0008RX-VY
 for bug-gnu-emacs@HIDDEN; Fri, 10 Nov 2023 02:51:14 -0500
Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1r1MIJ-00027H-Br
 for bug-gnu-emacs@HIDDEN; Fri, 10 Nov 2023 02:51:13 -0500
Received: by mail.gandi.net (Postfix) with ESMTPSA id C797A40008
 for <bug-gnu-emacs@HIDDEN>; Fri, 10 Nov 2023 07:51:05 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; treesit-forward-sexp not working properly in ruby-ts-mode
Organization: LINKOV.NET
Date: Fri, 10 Nov 2023 09:42:17 +0200
Message-ID: <86bkc2nktq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-GND-Sasl: juri@HIDDEN
Received-SPF: pass client-ip=2001:4b98:dc4:8::222;
 envelope-from=juri@HIDDEN; helo=relay2-d.mail.gandi.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

--=-=-=
Content-Type: text/plain

X-Debbugs-Cc: dmitry@HIDDEN

Please try these 5 cases described in the comments of this diff:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=ruby-ts-mode.patch

diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby.rb b/test/lisp/progmodes/ruby-mode-resources/ruby.rb
index 81d0dfd75c9..abe6a0789b9 100644
--- a/test/lisp/progmodes/ruby-mode-resources/ruby.rb
+++ b/test/lisp/progmodes/ruby-mode-resources/ruby.rb
@@ -123,6 +123,7 @@ def test2 (arg)
     puts "there"
   end
 
+  # from "elsif" and "then" C-M-f should jump to next "elsif"/"else" like with { }
   if a == 2 then
     puts "hello"
   elsif a == 3
@@ -179,6 +180,7 @@ def test2 (arg)
     bar,
     :a
 
+# when point is after @, C-M-f should jump to the end of symbol
 zzz @abc,
     4
 
@@ -211,10 +213,16 @@ def test2 (arg)
 
 class C
   def foo
-    self.end
+    self.end # when point between 'e' and 'n', C-M-b should jump to "self"
     D.new.class
   end
 
+  class << self
+    def bar
+    end
+  end
+  # C-M-b at the end of "end" should jump to "class"
+
   def begin
   end
 end
@@ -522,6 +530,9 @@ def qux
   puts "Japanese translation: #{orig_text} => #{trans_text}"
 end
 
+# C-M-f on '[' doesn't jump to after ']'
+hash['key']
+
 # Tokenizing "**" and "|" separately.
 def resolve(**args)
   members = proc do |**args|

--=-=-=
Content-Type: text/plain


Is it possible to improve ruby-ts-mode to handle these cases?

--=-=-=--




Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
New bug report received and forwarded. Copy sent to dmitry@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to dmitry@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#67036; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 25 Nov 2023 09:30:02 UTC

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