From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly Date: Tue, 24 Jan 2023 09:17:53 -0500 Message-ID: References: <1a2436ef-ff4d-827c-f22f-33b0737d9b1f@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3522"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61017@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 24 15:19:31 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 1pKK95-0000nC-4V for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Jan 2023 15:19:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKK8h-0008DC-Fq; Tue, 24 Jan 2023 09:19:07 -0500 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 1pKK8e-0008Cs-B0 for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 09:19:05 -0500 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 1pKK8c-0000dU-V5 for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 09:19:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pKK8c-00062s-E9 for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 09:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Jan 2023 14:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61017 X-GNU-PR-Package: emacs Original-Received: via spool by 61017-submit@debbugs.gnu.org id=B61017.167456989323180 (code B ref 61017); Tue, 24 Jan 2023 14:19:02 +0000 Original-Received: (at 61017) by debbugs.gnu.org; 24 Jan 2023 14:18:13 +0000 Original-Received: from localhost ([127.0.0.1]:56169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKK7o-00061n-RO for submit@debbugs.gnu.org; Tue, 24 Jan 2023 09:18:13 -0500 Original-Received: from mail-pl1-f172.google.com ([209.85.214.172]:43768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKK7n-00061b-0h for 61017@debbugs.gnu.org; Tue, 24 Jan 2023 09:18:11 -0500 Original-Received: by mail-pl1-f172.google.com with SMTP id d3so14834448plr.10 for <61017@debbugs.gnu.org>; Tue, 24 Jan 2023 06:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rV8qlWdiQK4XEtbi/8DZscozoozGysJHb0oeWjs5l4A=; b=DfoYIDm7Rh0E9Rcv4i+HqlwkU6NKqzvmvhEmUJn9BreN2p2SuDMIWH2fC7pYL1usy3 prP6bm8P8ITBhDAY5HvI0w4xOR1jfEG/nhjXB1kMLE1DXo+DgFanpKVmh8jh9f622M54 t35J+K356mRRqLTJQnj5MkZLbGFUQjoRLNDIPbnqi5HPjMSZFczRzzsgZLRbKcNRqXge hlUt+u/JdIqtExAWNtlKaR6dcBCk9KY8MKm1sbyrkztsal9CuX1P0oSYQvO7KcD2y6/E 4CMCmiYDOUaHSc9d59ZBt4GfvoQP8+h7EQHY8+HdIH4TAsA2jun6lkGJ/E4Y5gFfAX2L gHuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rV8qlWdiQK4XEtbi/8DZscozoozGysJHb0oeWjs5l4A=; b=OkbTowC7kO37aMvswcLDajcgCpoFgyrr/drF3dcHq1p8bvUCzAtki8gMbXMXdPneiL 5PzvFpd5cTFPfDWejMOjlN8wAVk8DgA5dyNiBcjtQqstLnzueXIVeI0uEDIcIorE2ZsQ YzxcvTlKGiljbQ2m6kBCCLkeGzUEq9p+mcYsHxRc6fDJ1fuY/dUd7tzf0LvaWPFvquHL 7109fF1r8xM2mBUxGlhA+AbMZS+MWdL8aftqUj0LnPj57WxsgICAe3FBGmEfvD5NWgge VWAfNtnbSc5dTxCDpDIEUv+/om+rv9yN0Iou66WSA4jp3N/me969j7paUKCYoiA/yabd v+qA== X-Gm-Message-State: AFqh2kr3zYjxd1PMpkHKfdCCB/ntO6TjXBOPS1hYDXUhxZcLYCkRzcWi Se0PPD+TcHJ09827o2dE9f0lFK/mO4eFd8kd30M= X-Google-Smtp-Source: AMrXdXv7pg6TgtSTQ4AG9GVKdd9Gnl8vAOLlmOqYoj+DHj2nKbrP8xCtE5zlDEmEkeLIXeb2VEMhMajn5FaIXvfuQu0= X-Received: by 2002:a17:90b:3717:b0:226:9d77:e730 with SMTP id mg23-20020a17090b371700b002269d77e730mr3152417pjb.198.1674569884548; Tue, 24 Jan 2023 06:18:04 -0800 (PST) In-Reply-To: <1a2436ef-ff4d-827c-f22f-33b0737d9b1f@yandex.ru> 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:254050 Archived-At: On Mon, Jan 23, 2023 at 4:28 PM Dmitry Gutov wrote: > > Hi! > > On 23/01/2023 06:33, Aaron Jensen wrote: > > > > Start with a buffer in ruby-ts-mode like: > > > > a > > > > b > > > > Between the two lines, type "class Foo", then press enter > > > > You should get this: > > > > a > > > > class Foo > > > > b > > > > But this is expected: > > > > a > > > > class Foo > > > > b > > > > Note that reindenting after adding the "end" will indent correctly, so > > it's only an issue with electric indent > > Thanks for the report, the problem here is that such examples parse into > a malformed syntax tree: > > (program (identifier) > (ERROR class (constant) (identifier))) > > Another example would be: > > class C > def foo > > which parses as > > (ERROR class (constant) def (identifier)) > > We can try to anticipate such cases and infer the implied structure > somehow, or just disable indentation for specific cases. See the > attached patch for the latter. > > Is it enough of an improvement? That seems to make indentation after an open def not happen: def foo bar end I applied the patch manually though, so maybe you can confirm that you see the same thing?