| Summary: | Nested parentheses during function completion | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Nathan Ridge <zeratul976> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | noopur_gupta |
| Version: | 4.7 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Bug 473574 is related, except in that case, the parenthesis is inside a string literal. I run into this very frequently while working on Eclipse projects (such as CDT), because the prevailing coding style involves frequent casting, so argument expressions of the form "(Interface) variable" are very common. *** This bug has been marked as a duplicate of bug 477615 *** |
Steps to reproduce: 1) Enter the following code into an editor: public abstract class Test { interface A {} interface B {} void foo(A a) {} abstract B bar(); void caller() { B b = bar(); fo/*cursor*/ } } 2) Invoke content assist at the indicated location. 3) Select the completion proposal for foo(). 4) Start typing the argument expression "(A) b" (without quotes). Expected results: When you type the closing parenthesis in the (A), the cursor does not move. Actual results: When you type the closing parenthesis in the (A), the cursor jumps to the end of the statement, leaving you will the following incomplete statement: foo((A);/*cursor*/ JDT should be keeping track of the fact that I typed an opening parenthesis as part of the argument expression, and that therefore the closing parenthesis is just closing that, rather than the entire function call expression.