score:0

type for and then hit ctrl + space.

score:1

yes, postfix completion was introduced in eclipse 4.14 (december 2019).

it works similarly to intellij. for your example, if you type

    int count = 10;
    count.

and invoke autocomplete ("content assist", ctrl-space), eclipse will offer the completion "foriub", which will yield the same loop as in intellij. there's also "forllb", which will yield a loop counting backwards.

notes:

  • for content assist to work, the cursor must be behind the dot. also, the dot is required to invoke the postfix completion.
  • postfix completion must be enabled in the eclipse preferences (should be enabled by default). to check, got to window / preferences / java / editor / content assist / advanced. there, the category "java postfix template proposals" must be enabled.

Related Query

More Query from same tag