bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54702: 29.0.50; ruby-mode indentation: endless methods


From: Dmitry Gutov
Subject: bug#54702: 29.0.50; ruby-mode indentation: endless methods
Date: Fri, 16 Dec 2022 02:33:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

Hi Aaron,

Sorry for the long pause. You said you're using something else, though, so it didn't seem urgent (and I've yet to encounter endless methods at $day_job, FWIW).

On 28/04/2022 02:58, Aaron Jensen wrote:
On Tue, Apr 26, 2022 at 10:44 PM Dmitry Gutov <dgutov@yandex.ru> wrote:
Thanks for the report.

I'll work on this further, but here's a quick-and-dirty patch to fix the
indentation problems.

Great, thank you. I've since moved back to enh-ruby-mode and I was
able to patch it to support this (though that project appears to be
currently not accepting contributions).

Not a problem for me, but could you test the attached patch anyway?

It seems to handle a bunch of different/complex cases fine without regressions, but it's always better with a second pair of eyes.

I'd probably use ruby-mode if
it supported indenting long parameter/argument lists the way the
non-smie version does, like this:

def some_method(
   some_param,
   some_other_param
)

Now that the SMIE stuff is again in my short-term memory, it shouldn't be too hard. Just please file a separate bug report (slash feature request) with a precise example. Bonus points for linking to a relevant Rubocop rule, so that we can pick a better name for the new user option.

I don't see the non-SMIE version indenting it like this -- it looks more like this instead (and only if I set ruby-deep-indent-paren to nil):

def test2 (
    asd,
    asd
    asd
    )

So let's start with a couple of good examples.

I believe I've seen you imply concerns about enh-ruby-mode -- do you
have any aside from the fact that it's not in core and it requires a
ruby process? It's mostly worked well for me, but I don't know what I
don't know.

My main problem with it is the spotty maintenance like in this example: https://github.com/zenspider/enhanced-ruby-mode/issues/96

But it might work fine for many people. Especially those who don't use Robe.

Some previous versions of it (probably by the previous maintainer) were really broken, so I just took up ruby-mode instead. I haven't tried using its latest versions much.

Attachment: ruby-endless-methods.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]