Community
Participate
Eclipse IDE
In a Java editor, I find that whenever I go to type: Table table = new Table(shell, SWT.NONE); I end up with: Table table = new Table(shell, SWT.NONE; What happens is that hitting ';' seems to cancel the completion, and deletes the closing parenthesis in the process. This is really annoying for me, since I am a fast typer and often find it faster to type the full text in rather than select the first match. Here are the exact steps to reproduce: 1. On a new line: Table table = new Table(shell, SWT. 2. Wait for the code assist drop-down to appear. 3. Type "NONE)". 4. Note that the code assist drop-down is still visible. 5. Hit ";". The ")" is now replaced by a ";", leaving: Table table = new Table(shell, SWT.NONE;
Works for me. What are your settings? Tom, can you reproduce?
can reproduce. - parentheses closing must be on -> during step 1, the closing parenthesis is inserted - smart semicolon setting does not matter The problem seems to be that the proposal popup is not dismissed upon typing ')'. Then the semicolon somehow gets replaced by some typing smartness... Disposing the popup with 'Esc' and then typing ';' works as expected.
we should investigate a fix for RC2
The proposal shell should already hide when you type in the closing parenthesis. The problem is that the parenthesis is already in the document from the auto-closing feature. Now typing it does not modify the document, but only the caret is moved behind the parenthesis. Since no modification happens, ICompletionProposal.validate is not called. In fact CompletionProposalPopup does not get involved at all when the caret is changed programmatically. There really is no way to detect the caret change as the SelectionListener on StyledText does not fire changes as long as the selection has no length. A possible workaround on our side is to validate proposals before they are inserted. Currently, proposals are validated when the selection is changed by using the arrow keys, or when the document is modified, but not before insertion.
Deferred. Fix is too risky at this time.
Not a regression from 3.0. Hint: you can disable auto-closing of parenthesis to avoid this, or: use code assist instead of typing yourself ;-)
I curse you Billy. All of 3.1, I didn't see this bug at all. (Confirmed: I do see this same problem in 3.0.2.) Then you mention the bug, 3.1 ships, and now this bug is driving me up the wall.
Doug, check your settings. You probably changed them
Note that increasing the auto-assist delay will make this better somewhat, as you won't get automatic code assist as much.
Marking as potential 3.1.1 candidate. Final decision depends how the fix looks like.
I don't think I changed any settings related to the editors in quite some time. Which setting in particular do you feel I should check?
auto-closing of parenthesis
I believe the preference Dani is talking about is: Java > Editor > Typing > Automatically close ... (Parentheses), [square] and <angle> brackets. In my workspace, I believe it is still at its default setting (i.e., checked). I don't recall ever having changed this setting, and restoring defaults does not change it.
I released a fix to HEAD. Port to 3.1.1 will have to wait for the review.
Tom, can you attach a patch against 3.1.
Created attachment 25664 [details] jdt-ui.diff Patch against R3_1 of jdt-ui, fixing the problem by revalidating the proposals before applying them.
Patch is good for 3.1.1. Committed fix to R3.1.1.
Start verifying...
Can't be verified yet since patch isn't in M20050804-1200. Got released 0805. I tested it in M20050804-1200 and the problem is still in.
Start verifying again...
Verified on M20050831-1200 plus plug-in export.