Indentation Bugs

66 views
Skip to first unread message

Ruediger Keller

unread,
Sep 11, 2011, 5:04:31 AM9/11/11
to scala-i...@googlegroups.com
Hello,

I don't know if this is a known issue, but the Eclipse plugin has some
annoying bugs regarding indentation for me. In the following, when I
write "Tab" I mean to press the Tab key. I'm actually indenting using
2 spaces, as is common with Scala, I think.

Indenting with the Tab key is only working correctly when I want to
indent a single line pressing Tab. When using Tab or Shift+Tab on
multiple lines, there is always some strange behavior. The most common
is that an additional non-selected line below the selection is also
indented/unindented. This is also always happening when using
Shift-Tab on a single line. When working with multiple lines,
sometimes indentation with Tab is not working at all (seen with a
triple quoted string over many lines), and sometimes some lines in the
selection are indented, some not. The latter happens primarily when
working with XML literals, IIRC.

Another bug which is quite annoying is that when using Ctrl+Alt+Down
or Ctrl+Alt+Up on a selection to duplicate it, the duplicated
selection is reindented, usually leading to some parts being indented
too much and some not enough. The same happens when moving a selection
with Alt+Up / Alt+Down. Example:

Lines being duplicated:
dict foreach { case (k, v) =>
println(k.mkString(""))
println(v.mkString("\n"))
}

Result 1 from using Ctrl+Alt+Down:
dict foreach { case (k, v) =>
println(k.mkString(""))
println(v.mkString("\n"))
}

Result 2 from using Ctrl+Alt+Up:
dict foreach { case (k, v) =>
println(k.mkString(""))
println(v.mkString("\n"))
}

This could probably be solved by not touching the indentation of the
duplicated block of code. Proper reindentation for moving a block
would be nice though, but probably hard to do right. Btw. while
Tab/Shift-Tab was working properly some weeks ago, Ctrl+Alt+Up/Down
and Alt+Up/Down was never working properly, AFAIR.

Also, I want to mention that the
"one-additional-line-below-the-selection-is-also-affected-bug" also
applies to commenting and uncommenting lines using Ctrl+7.

Are these known issues? I hope they are worked on with high priority,
as these are all quite common and basic tasks. Also, Tab, Shift-Tab
and Ctrl+7 were working properly some weeks ago, so this seems to be a
regression.

Btw. I'm using version 2.0.0.beta09-29-201107201639-529111d on Windows
7 and it happens both with 32bit Helios and 64bit Indigo.

Finally, despite of my criticism, I want to thank the devs for their
hard work, the plugin has made some really great progress in the last
months!

Regards,
Rüdiger

Matt Russell

unread,
Sep 11, 2011, 9:24:56 AM9/11/11
to scala-i...@googlegroups.com
On Sunday, September 11, 2011 10:04:31 AM UTC+1, Ruediger Keller wrote:

I don't know if this is a known issue, but the Eclipse plugin has some
annoying bugs regarding indentation for me. 

Are these known issues? I hope they are worked on with high priority,


as these are all quite common and basic tasks. 

Hi Ruediger,

The "one-additional-line-below-the-selection-is-also-affected-bug" bug has been fixed in the nightlies for a while now.

There are quite a few tickets in the issue tracker about various types of problem with indentation. I've spent a lot of this weekend duplicating triple-quoted strings and suffering random re-indentation, so I feel your pain!

Because I've worked on the code formatter and various syntactic bits and bobs, I'm probably well placed to help out. There are a couple of features that are higher priority (for me!) that I'm working on right now, e.g. semantic highlighting, but indentation bugs are high up on my list after that (if no-one gets there first).

-- Matt

Reply all
Reply to author
Forward
0 new messages