Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325785 - [formatter] When line wrapping is needed, the line is wrapped after assignment, not at function call argument list
Summary: [formatter] When line wrapping is needed, the line is wrapped after assignmen...
Status: RESOLVED INVALID
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 7.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-20 15:03 EDT by Dmitry Katsubo CLA
Modified: 2010-10-22 04:52 EDT (History)
0 users

See Also:


Attachments
Result of actual formatting (114 bytes, application/octet-stream)
2010-09-20 15:04 EDT, Dmitry Katsubo CLA
no flags Details
Result of expected formatting (134 bytes, application/octet-stream)
2010-09-20 15:05 EDT, Dmitry Katsubo CLA
no flags Details
Result of actual formatting v2 (327 bytes, application/octet-stream)
2010-10-18 11:57 EDT, Dmitry Katsubo CLA
no flags Details
Result of expected formatting v2 (510 bytes, application/octet-stream)
2010-10-18 11:57 EDT, Dmitry Katsubo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Katsubo CLA 2010-09-20 15:03:59 EDT
Build Identifier: CDT Build id: 201006141710

It looks like the formatter tries to keep the the function call argument list untouched (higher priority?). See attachments.

Reproducible: Always
Comment 1 Dmitry Katsubo CLA 2010-09-20 15:04:49 EDT
Created attachment 179270 [details]
Result of actual formatting
Comment 2 Dmitry Katsubo CLA 2010-09-20 15:05:11 EDT
Created attachment 179271 [details]
Result of expected formatting
Comment 3 Anton Leherbauer CLA 2010-09-29 04:51:12 EDT
The example is not complete, it parses with a syntax error.
If I fix the syntax error, the example does wrap correctly with default code style, and also with the style attached to bug 325783 (after changing the maximum line width to 80).
Comment 4 Dmitry Katsubo CLA 2010-10-18 11:57:03 EDT
Created attachment 181107 [details]
Result of actual formatting v2
Comment 5 Dmitry Katsubo CLA 2010-10-18 11:57:25 EDT
Created attachment 181108 [details]
Result of expected formatting v2
Comment 6 Dmitry Katsubo CLA 2010-10-18 11:58:25 EDT
Better example is attached.
Comment 7 Anton Leherbauer CLA 2010-10-22 04:52:22 EDT
(In reply to comment #6)
> Better example is attached.

This specific example is a corner case, as the wrapping occurs on the semicolon and not inside the function call expression, i.e. in this case it is correct to wrap the assignment.

Unfortunately there is no option to control the wrapping of assignments, but that's a different issue.