I have a problem whenever I use the Scanner class in my java code:
Say I type
Scanner in = new Scanner(System.in)
Scanner in = new Scanner(System.in;
I can reproduce this behaviour both in Eclipse Mars and Eclipse Neon, and for me it looks like a bug.
In particular, when I press ) to over-type the auto-inserted
), the content assist window suggesting
System.in stays open, and ; then selects it and eats the
Therefore I opened a bug report for it:
To work around it (until it is fixed), you can disable one of the involved features: auto-inserting closing parenthesis, content assist (i. e. auto completion) or that content assist triggers on typing a semicolon. (All of these are available in the global preferences unter
Java -> Editor). Alternatively you can live with the bug and close content assist either by accepting
System.in with Enter, or by pressing Esc any time after the suggestion window opens but before typing the semicolon.