Community
Participate
Working Groups
N20110213-2000 package xy; class Bug { void foo() { set } void setAnswer(boolean answer, int n) { } boolean getAnswer() { return true; } } - Have "Java Editor > Content Assist > Insert best guessed arguments" selected and "Java Editor > Typing > Auto-insert Semicolon" unchecked - invoke content assist after "set" - press Enter to accept first proposal - press End - press ; => line is "setAnswer(;|, 0)" where | is the caret Expected: Semicolon should be inserted at end of line where the caret was.
Created attachment 188938 [details] Fix Dani please speak up if you don't like the fix. I've removed an "if (key == ';')" check in the language-agnostic CompletionProposalPopup2 that was there for no good reason, and I changed the additional trigger character in ParameterGuesser from ';' to ',', which also fixes bug 154740.
*** Bug 154740 has been marked as a duplicate of this bug. ***
Comment on attachment 188938 [details] Fix +1 for the fix.
Fixed in HEAD.
Actually, the fix breaks an important scenario: 1. take example from comment 0 and remove the second argument from setAnswer 2. code complete after "set" 3. press ';' ==> semicolon replaces the selection instead of adding it at the end.
(In reply to comment #5) Yeah, that's what you used to get for free, but it's actually another scenario that was broken. With "Auto-insert Semicolon" unchecked, typing ";" should just mean "replace the selection with a ;". And that's what we do in HEAD. To get the semicolon at the end, you need to enable the preference.
(In reply to comment #6) > (In reply to comment #5) > Yeah, that's what you used to get for free, but it's actually another scenario > that was broken. With "Auto-insert Semicolon" unchecked, typing ";" should just > mean "replace the selection with a ;". And that's what we do in HEAD. > > To get the semicolon at the end, you need to enable the preference. Indeed. I'm so used that the semicolon is auto-inserted that I forgot about this in my new test workspace.