From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#62086: 29.0.60; ruby-ts-mode regressions Date: Wed, 05 Apr 2023 09:24:24 +0300 Organization: LINKOV.NET Message-ID: <865yaakfs7.fsf@mail.linkov.net> References: <86y1o5op2v.fsf@mail.linkov.net> <5abcf765-f8ce-9563-63aa-20c558409898@yandex.ru> <86cz4l7zjk.fsf@mail.linkov.net> <86ttxww12o.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24805"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 62086@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 05 08:29:25 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjwe5-0006I9-I3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Apr 2023 08:29:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjwdo-0000KF-0t; Wed, 05 Apr 2023 02:29:08 -0400 Original-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 ) id 1pjwdm-0000K0-Fq for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 02:29:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjwdi-00075p-LU for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 02:29:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pjwdi-0002EW-HL for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 02:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Apr 2023 06:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62086 X-GNU-PR-Package: emacs Original-Received: via spool by 62086-submit@debbugs.gnu.org id=B62086.16806761118508 (code B ref 62086); Wed, 05 Apr 2023 06:29:02 +0000 Original-Received: (at 62086) by debbugs.gnu.org; 5 Apr 2023 06:28:31 +0000 Original-Received: from localhost ([127.0.0.1]:50674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjwdD-0002D5-3t for submit@debbugs.gnu.org; Wed, 05 Apr 2023 02:28:31 -0400 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:47601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjwdA-0002Ce-U8 for 62086@debbugs.gnu.org; Wed, 05 Apr 2023 02:28:29 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 414D1100003; Wed, 5 Apr 2023 06:28:20 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Wed, 5 Apr 2023 03:06:52 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259247 Archived-At: >> I wonder is it possible to fix more. >> Many parens/brackets are still not matched in e.g. >> test/lisp/progmodes/ruby-mode-resources/ruby.rb >> such as parens in def argument list: >> def test1(arg) > > This one was a regression from the addition of strict bos/eos anchors, now > fixed. Maybe there are more types that now are not found, but probably easier to add them one by one after testing than to try finding all of them in https://github.com/tree-sitter/tree-sitter-ruby/blob/master/src/node-types.json or in https://github.com/tree-sitter/tree-sitter-ruby/blob/master/src/grammar.json >> and in >> method (a + b), > > When you say that this is broken, do you mean that these parens get jumped > over unexpectedly (with forward-sexp movement ending at the end of the > arguments list)? It seems natural to expect that when point is on an opening paren/bracket then 'C-M-f' should jump to its closing pair. At least, this is more WYSIWYG. > This is an artefact of the implementation of treesit-forward-sexp. > It might be possible to improve, but from a brief dig, it has some > internal logic. So some care would need to be taken to decide which > contract nedds changing. This is an example where explicit parens conflict with implicit parens. Visible parens have the type "parenthesized_statements", but invisible parens have the type "argument_list". Both start at the same position. So maybe treesit-forward-sexp should prefer the former over the latter? And in a similar case method [], arg2 maybe "array" should take precedence over "argument_list". >> Also square brackets are not matched by 'C-M-f' in >> h[:key] > > And this, surprisingly, seems impossible to handle just using > treesit-sexp-type-regexp. The brackets are present in the tree, but they > are not at the ends of any node. So that will require some custom Lisp, > I guess. This is the same problem that occurs in other places such as in "#{ddf}" where only '#' but not '{' matches '}'. So adding "element_reference" will allow to jump only from the beginning of an identifier.