Community
Participate
Working Groups
Build ID: I20070625-1500 Steps To Reproduce: 1. Declare functions foo() and foz() 2. Type foo(), delete the "foo" 3. Press CTRL+SPACE, select foz and you'll end up with "foz()()" More information: The autocompletion could be much more smarter if it would not just insert the statement I chose (including the brackets behind) but to replace only the changed parts. If I press CTRL+SPACE over a function for example and select a different one in the drop-down box the function should be swapped, not inserted, or I'd end up with things like "fofoz()o()"
JDT.core decides about the replacement length here. It could add the brackets, but the analysis to do so is not easy.
Given how often one sees it perhaps using a brute force solution would be a good stop-gap solution? Brute force as in 'check if the next two characters are "()" and don't insert an extra pair' or 'check if the next two characters are "()" and delete them because we have already inserted an extra ()'. The someMethod()() problem is so common that I believe it should be handled even if the solution works only for this single special case.
*** This bug has been marked as a duplicate of bug 57460 ***