Bug 546853 - [12] Formatting for space before '->' in Switch expression case and default after rewrite
Summary: [12] Formatting for space before '->' in Switch expression case and default a...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.12   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug bulk move
Keywords:
Depends on: 546146
Blocks: 545831 536055 549962
  Show dependency tree
 
Reported: 2019-04-30 05:43 EDT by Sarika Sinha CLA
Modified: 2023-08-11 02:27 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sarika Sinha CLA 2019-04-30 05:43:42 EDT
Taking out Bug 546146.

The rewrite formatting does not take care of the project formatter setting for space before '->' in case and default.
Comment 1 Sarika Sinha CLA 2019-04-30 05:45:31 EDT
ASTRewrite does not provide the formatting for space before ":" in case and default, so this needs an investigation.
Comment 2 Noopur Gupta CLA 2019-04-30 07:27:33 EDT
Mateusz, can you please check?
Comment 3 Mateusz Matela CLA 2019-05-02 08:59:18 EDT
I'm not sure, is this bug about something inside the formatter? I'm not familiar with the ASTRewrite.
Comment 4 Noopur Gupta CLA 2019-05-03 06:10:36 EDT
I don't see anything done in UI to handle this. A call to ASTRewrite.rewriteAST() gives back the correct result for ':' case. 

(In reply to Mateusz Matela from comment #3)
> I'm not sure, is this bug about something inside the formatter? 
> I'm not familiar with the ASTRewrite.
Sarika, please clarify.
Comment 5 Sarika Sinha CLA 2019-05-06 01:10:23 EDT
(In reply to Mateusz Matela from comment #3)
> I'm not sure, is this bug about something inside the formatter? I'm not
> familiar with the ASTRewrite.

Yes, it looks like formatter. we need to find where formatter takes care of space before ":" in default and case, similarly it needs to be done for "->".
Comment 6 Eclipse Genie CLA 2019-05-11 15:35:58 EDT
New Gerrit change created: https://git.eclipse.org/r/142018
Comment 7 Mateusz Matela CLA 2019-05-11 15:58:33 EDT
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/142018

This is a fix as described in bug 546146 comment 15.
I don't know how to make a unit test for it, so you can prepare one or point me in the right direction.
Comment 8 Sarika Sinha CLA 2019-05-13 02:10:18 EDT
@Manoj,
Please confirm if this is fine.
Comment 9 Manoj N Palat CLA 2019-05-16 00:53:20 EDT
(In reply to Sarika Sinha from comment #8)
> @Manoj,
> Please confirm if this is fine.

Thanks for the fix, Mateusz.
@Sarika: 
From the quick fix point of view, this solution looks ok. However, I am not too familiar with the TextEdit nuances, so I would suggest checking this with a more involved multi-text edit case. ie write a test case where default is added and then another edit of the rhs is done.for eg, add default->3, then change 3 to 4 and see whether this has any issue and similar ones with case. If these tests go through fine, +1 from my side.
Comment 10 Sarika Sinha CLA 2019-05-20 04:36:35 EDT
Moving to 4.13 to add a test case and test.
Comment 11 Manoj N Palat CLA 2019-08-27 02:07:18 EDT
Bulk move out of 4.13
Comment 12 Eclipse Genie CLA 2021-08-18 05:55:47 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 13 Eclipse Genie CLA 2023-08-11 02:27:29 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.