Bug 506148 - [typing] "Smart" semicolon auto-inserts at end of line in wrapped statements
Summary: [typing] "Smart" semicolon auto-inserts at end of line in wrapped statements
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-18 09:39 EDT by Markus Keller CLA
Modified: 2024-02-28 07:04 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.