| Summary: | [content assist] Method proposal wrongly terminates template mode and swallows ")" (closing parenthesis) | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ctg, zeratul976 |
| Version: | 4.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | stalebug | ||
*** Bug 492405 has been marked as a duplicate of this bug. *** *** Bug 511431 has been marked as a duplicate of this bug. *** This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
4.6.0.I20150915-2000 There's a bad interaction between two features: a) Method completion proposal that swallows a typed ")" at the end of the argument list b) Auto-insertion of ")" when the user types "(", and skipping of the ")" when typed before an existing ")" Steps: - have this code snippet and replace "|" with caret: public static void main(String[] args) { System.out.print(Stream.gen|); } - press Ctrl+Space => inserts "Stream.generate(s)", "s" selected, template mode started - type ( => inserts "(", steals the ")" after the caret and enters a nested template mode. - type ) => the closing parenthesis ends the nested template mode and makes the caret jump over the ")" that closes the generate(..) method invocation. Result (| is the caret): System.out.print(Stream.generate(()|); Note the missing ")" at the end. The problem is that functionality (b) doesn't work correctly, since the inserted ")" is wrongly consumed by the outer linked mode. The assumption that the inserted ")" closes the method invocation is invalid. Not only since the introduction of lambdas. It also happens when you complete "new Intege" and then type "(1+2)/3". We have to make sure that the method invocation proposal doesn't stop the insertion of the auto-closing ")".