GNU bug report logs -
#15594
24.3; Indentation of method arguments without parentheses in ruby-mode is broken
Previous Next
Full log
Message #14 received at 15594 <at> debbugs.gnu.org (full text, mbox):
Hi Stefan,
thanks for starting on this feature. Comments and questions follow.
> revno: 114639
> revision-id: monnier <at> iro.umontreal.ca-20131012204050-2kntbtokz1wa3mk5
> parent: eggert <at> cs.ucla.edu-20131012200038-eeyl9fi1y3vr0vwy
> committer: Stefan Monnier <monnier <at> iro.umontreal.ca>
> branch nick: trunk
> timestamp: Sat 2013-10-12 16:40:50 -0400
> ...
> +(defun ruby-smie--args-separator-p (pos)
> + (and
> + (eq ?w (char-syntax (char-before)))
> + (< pos (point-max))
> + (memq (char-syntax (char-after pos)) '(?w ?\"))))
I've made a change to the first condition in 114655, but the last line
is still very inadequate.
The first argument can be any kind of literal, parenthesized expression,
or even (if we want to get fancy) something like `begin foo; bar end'.
(See new examples is indent/ruby.rb).
So basically, I think we'd like to check if the token following POS is
either not "special", or if it is, it begins an expression. Can we do
that?
> === modified file 'test/indent/ruby.rb'
> --- a/test/indent/ruby.rb 2013-10-11 20:45:14 +0000
> +++ b/test/indent/ruby.rb 2013-10-12 20:40:50 +0000
> @@ -170,3 +170,7 @@
> if foo &&
> bar
> end
> +
> +method1 arg1, # bug#15594
> + method2 arg2,
> + arg3
Please note that you've added the example to the "currently failing"
part of the file. I've moved it now.
This bug report was last modified 11 years and 208 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.