Bug 506148

Summary: [typing] "Smart" semicolon auto-inserts at end of line in wrapped statements
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: minor    
Priority: P3 CC: daniel_megert, erik.brangs, gautier.desaintmartinlacaze
Version: 4.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Markus Keller CLA 2016-10-18 09:39:00 EDT
The "Preferences > Java > Editor > Typing > Automatically insert at correct position > Semicolons" option auto-inserts a semicolon at the end of the current line in wrapped statements. This is clearly not more correct than the location where the user placed the caret.

Example (the long string literal is on one line):

public class A {
    void foo() {
        StringBuilder sb = new StringBuilder();
        sb.append('[').append("Some long content that will make the formatter insert line breaks somewhere around here")
                .append(']');
    }
}

- set caret after "sb.append('[')"
- type ";"
=> was: semicolon gets added at the end of the line
=> expected: since there's no semicolon missing, the correct insertion position is the caret location
Comment 1 Eclipse Genie CLA 2021-09-21 14:18:13 EDT
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.
Comment 2 Dirk Steinkamp CLA 2022-03-04 18:37:46 EST
Seems to be fixed in the meantime. Can't reproduce with 4.23M3.
Comment 3 Eclipse Genie CLA 2024-02-28 07:04:14 EST
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.