Bug 566323 - [code templates] empty indented lines are stripped away
Summary: [code templates] empty indented lines are stripped away
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: accessibility, usability
Depends on:
Blocks:
 
Reported: 2020-08-24 10:30 EDT by Blood Eko CLA
Modified: 2022-09-23 13:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Blood Eko CLA 2020-08-24 10:30:21 EDT
----------(possible format)
    @Override
    public void run() {
        //TODO Auto-generated method stub
    }
----------(possible format)
    @Override
    public void run() {
        x
    }
----------(impossible/desired format)
    @Override
    public void run() {
        <--- note spaces
    }
----------

Currently when working with the formatter it is always required to manually
reformat the created code. Either when using the default format to delete the
comment, or with a changed tempate to recreate the now missing line or indention.

So it would be a nice enhancement to allow indented lines which dont require this
further manual formatting before writing the actual code for a higher productivity.

There are options with the formatter to get a blank line or a blank indented line
but these are not really solutions, as still manual formatting would be required 
and even worse the whole formatter is affected in a way it shouldn't.

What seems to be the problem is that emptyStrings/newlines/tabs/spaces can be 
written to the template but are ignored during code generation. With empty spaces
treated equally to the x symbole for the above code it would are be done.

Another possibility could be to add a new variable like ${indented_line}.
Though I don't know the sideffects for such changes, eventually there might
be an even better to solve this.
Comment 1 Eclipse Genie CLA 2022-09-23 13:15:19 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.