GNU bug report logs -
#16907
24.3.50; [ruby-mode] %w/W literals have incorrect indentation
Previous Next
Full log
Message #11 received at 16907 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>
> From: Bozhidar Batsov <bozhidar <at> batsov.com>
> To: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Saturday, March 1, 2014 at 1:00:52 PM
> Subject: Re: bug#16907: 24.3.50; [ruby-mode] %w/W literals have incorrect indentation
>
>
>
> --
> Cheers,
> Bozhidar
>
>
> On Saturday, March 1, 2014 at 3:55 AM, Dmitry Gutov wrote:
>
> > (This is probably too late for 24.4)
> >
> >
> >
>
> Hope it’s not :-) (although it’s not a big deal obviously).
> >
> > Bozhidar Batsov <bozhidar <at> batsov.com (mailto:bozhidar <at> batsov.com)> writes:
> >
> > > %w/W should be indented like other array literals.
> >
> > And %i/I too, I guess.
> Indeed. I forgot about them.
> >
> > Looks like this'll have to be done in two parts:
> >
> > 1. syntax-propertize the above cases differently from the rest of the
> > percent literals (which are treated like strings).
> >
> >
> >
>
> I was thinking more or less the same.
> >
> > Don't know exactly what syntax to use. The values can contain any
> > unpaired characters, except those delimiting them. Put syntax "symbol"
> > on everything inside them, except whitespace?
> >
> > And still handle interpolations somehow.
> Sounds reasonable. Not sure how hard it would be to implement.
> >
> > 2. Tokenize the elements inside the above literals without regard to
> > characters used in them. `ruby-smie--backward-token' and its counterpart
> > would have to be able to easily know when it's inside such literal.
> >
> > Alternatively, still propertize them as "general strings", but replace
> > `smie-indent-inside-string' in `smie-indent-functions' with a
> > specialized version that would look at what the string begins with.
> >
> >
> >
>
> Option 1 seems better/cleaner to me, but obviously I’m not as familiar as you with the existing code, so
> it’s ultimately your call.
>
> >
> > The change in syntax highlighting would have to be handled separately.
>
[Message part 2 (text/html, inline)]
This bug report was last modified 11 years and 163 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.