Bug 422328 - [formatter] SPACE is consumed and replaced by TAB
Summary: [formatter] SPACE is consumed and replaced by TAB
Status: UNCONFIRMED
Alias: None
Product: Xtend
Classification: Tools
Component: Backlog (show other bugs)
Version: 2.4.3   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-22 07:21 EST by Jakub Siberski CLA
Modified: 2013-11-22 07:21 EST (History)
0 users

See Also:


Attachments
Code example for autoformatter changing str template internals (263 bytes, application/octet-stream)
2013-11-22 07:21 EST, Jakub Siberski CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Siberski CLA 2013-11-22 07:21:15 EST
Created attachment 237642 [details]
Code example for autoformatter changing str template internals

In some cases, where TAB and 4xSPACE formatting is mixed, autoformatter is changing relative indentation of elements in string template

Test A
Assuming you have string template with 3 lines inside.
First line is not indented (not tabs/spaces before) => it starts at the beginning of the line.
Second line is indented by one tab in relation to first line.
Third Line is indented by 4 spaces to first line.
When you autoformat all three lines have the same indentation.


Test B
Assuming you have string template with 3 lines inside.
First line is indented by default number of tabs in relation to string template declaration.
Second line is indented by one tab in relation to first line.
Third Line is indented by 4 spaces to first line.
When you autoformat third line will have first space replaced by TAB.

So, in case B autoformatter changes [SPACE,SPACE,SPACE,SPACE] to [TAB,SPACE,SPACE,SPACE]. The workaround I had to use was formatting like in case A, which just looks terrible.

I am attaching code example, it might be more informative than my description.