JShell should add a tab if a new line is entered after an opening parentheses.

Jan Lahoda jan.lahoda at oracle.com
Tue Oct 21 14:13:55 UTC 2025


Hi David,

I've filled:
https://bugs.openjdk.org/browse/JDK-8370338


Thanks for the report,

     Jan


On 10/21/25 04:54, David Alayachew wrote:
> Hello @compiler-dev <mailto: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/20251021/c76e7055/attachment-0001.htm>


More information about the compiler-dev mailing list