JShell should add a tab if a new line is entered after an opening parentheses.
David Alayachew
davidalayachew at gmail.com
Tue Oct 21 02:54:20 UTC 2025
Hello @compiler-dev <compiler-dev at openjdk.org>,
Sometimes, when using JShell, I like to write code like this.
Stream.of(
some(complex(expression)),
another(kind, of(complex, expression)),
you(get, the, idea)
)
.parallel()
.map(...)
.forEach(...)
;
But when typing the above in JShell, the 3 expressions in the call to
Stream.of() are not indented. And in fact, even if I manually indent the
first expression, JShell will require me to do the same for the following
lines.
There's a couple of different ways to go about this. Maybe JShell could be
smarter about realizing where its current indent should be. For example, it
could just follow the indent of the previous line. That would let the user
pick the indent of their choice.
But from what little I have read of the JShell codebase, it sounds like it
would just be easiest to just make open parentheses + new line = increment
indent.
What do you think?
Thank you for your time and consideration.
David Alayachew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20251020/f614548e/attachment.htm>
More information about the compiler-dev
mailing list