Community
Participate
Working Groups
I type in: new SomeClassName(<<CARET>>); and invoke content assist and choose the constructor I want. Now I'm filling in parameters using the "tooltip" prompt. The constructor takes many parameters and I'd like to insert a newline while filling in parameters. When I press ENTER, instead of a newline, the caret is placed at the end of the constructor call: new SomeClassName(constantpool.contantx, )<<CARET>>; Note that this only occurs when auto-close parenthesis is enabled, and the starting case involved typing the parens, followed by invoking content assist. Suggested fix, ENTER to close auto-parens should not occur while the method/constructor argument hint window is visible. Only ")" should be active.
*** Bug 419898 has been marked as a duplicate of this bug. ***
A possible (more generic) solution would be to add the new line when some modifier is pressed while pressing 'Enter'. Like e.g. Shift+Enter currently ends the statement and adds a new line.
(In reply to Dani Megert from comment #2) > A possible (more generic) solution would be to add the new line when some > modifier is pressed while pressing 'Enter'. Like e.g. Shift+Enter currently > ends the statement and adds a new line. I don't quite understand why insertion of the newline should be conditioned on a modifier. Why not insert the newline whenever Enter is pressed? If the user wants the cursor to move outside of the closing parenthesis she can always press End.
(In reply to Sergey Prigogin from comment #3) > I don't quite understand why insertion of the newline should be conditioned > on a modifier. Why not insert the newline whenever Enter is pressed? If the > user wants the cursor to move outside of the closing parenthesis she can > always press End. This makes more sense to me. I want to insert a newline when I press Enter.
(In reply to Sergey Prigogin from comment #3) > (In reply to Dani Megert from comment #2) > > A possible (more generic) solution would be to add the new line when some > > modifier is pressed while pressing 'Enter'. Like e.g. Shift+Enter currently > > ends the statement and adds a new line. > > I don't quite understand why insertion of the newline should be conditioned > on a modifier. Why not insert the newline whenever Enter is pressed? If the > user wants the cursor to move outside of the closing parenthesis she can > always press End. Because 'Enter' first/mainly means: "choose the selected argument. As a bonus, we then move to the next one, or after the bracket if it was the last one: 1. new HashMap<code assist> and choose the int,float constructor ==> new HashMap<>([initialCapacity], loadFactor) 2. you can now choose between initialCapacity and 0, hit 'Enter' ==> new HashMap<>(0, [loadFactor]) For most people it would be a pain if 'Enter' adds a newline or doesn't move to the next argument in this scenario. Maybe a better approach would be to apply the formatter preference and already insert the newlines accordingly when the constructor is inserted: new HashMap<code assist> and choose the int,float constructor ==> new HashMap<>([initialCapacity], loadFactor) in that case, 'Enter' would then result in this: new HashMap<>(initialCapacity, [loadFactor])
(In reply to Dani Megert from comment #5) > Because 'Enter' first/mainly means: "choose the selected argument. As a > bonus, we then move to the next one, or after the bracket if it was the last > one: > > 1. new HashMap<code assist> and choose the int,float constructor > ==> new HashMap<>([initialCapacity], loadFactor) > 2. you can now choose between initialCapacity and 0, hit 'Enter' > ==> new HashMap<>(0, [loadFactor]) I always thought TAB was used to do this. i.e., similar to navigating across "focusable" controls in a dialog. And I never really need to use the TAB key unless I'm at the beginning of a line.