[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorre
From: |
Aaron Jensen |
Subject: |
bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly |
Date: |
Tue, 24 Jan 2023 09:17:53 -0500 |
On Mon, Jan 23, 2023 at 4:28 PM Dmitry Gutov <dgutov@yandex.ru> 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?
- bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly, Aaron Jensen, 2023/01/22
- bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly, Dmitry Gutov, 2023/01/23
- bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly,
Aaron Jensen <=
- bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly, Dmitry Gutov, 2023/01/24
- bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly, Aaron Jensen, 2023/01/24
- bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly, Dmitry Gutov, 2023/01/24
- bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly, Aaron Jensen, 2023/01/25
- bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly, Dmitry Gutov, 2023/01/25