| Summary: | Function parameter line wrapping wraps commas separating parameters | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Aaron Sabelko <aaron.sabelko> | ||||
| Component: | cdt-editor | Assignee: | Sergey Prigogin <eclipse.sprigogin> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Anton Leherbauer <aleherb+eclipse> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | cdtdoug, eclipse.sprigogin | ||||
| Version: | 8.0 | ||||||
| Target Milestone: | 8.0.2 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 203102 [details]
Demonstrates function parameter line wrapping behavior
Thanks for the test case. That's a regression compared to 7.0.2. Fixed in master and cdt_8_0. Sergey, could you review the fix if you see any potential problems with it? JUnit tests are green, but one never knows. Thanks. *** cdt git genie on behalf of Anton Leherbauer ***
Bug 357300 - Function parameter line wrapping wraps commas separating parameters
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=cd17d74157b9c6bb56241efb848b4238e2519e04
*** cdt git genie on behalf of Anton Leherbauer ***
Bug 357300 - Function parameter line wrapping wraps commas separating parameters
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=5c47f3f1a1317b4deac1407f7dac5b0de4d057f9
(In reply to comment #3) The fix unfortunately is incorrect since the tail formatter has to be set before calling node.accept(this) on the argument node. I've implemented a different fix and added a test case that would have caught the regression. *** cdt git genie on behalf of Sergey Prigogin ***
Bug 357300 - Function parameter line wrapping wraps commas separating
parameters. Corrected fix.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=e700877818c70b9a89d0a88c47f7add6619ff009
*** cdt git genie on behalf of Sergey Prigogin ***
Bug 357300 - Function parameter line wrapping wraps commas separating
parameters. Corrected fix.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=4bca28c52f40256f0f962e3c4477c1beacc02e5e
*** cdt git genie on behalf of Sergey Prigogin ***
Bug 357300. Stricter test case.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=baacf46add1ac5c8db7a367ea6151719fc320f48
*** cdt git genie on behalf of Sergey Prigogin ***
Bug 357300. Stricter test case.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=2deffc716f877e380771c42382a60703720441d3
(In reply to comment #6) > (In reply to comment #3) > The fix unfortunately is incorrect since the tail formatter has to be set > before calling node.accept(this) on the argument node. I've implemented a > different fix and added a test case that would have caught the regression. Thanks, I suspected there must be a reason to set it before node.accept(). |
Build Identifier: 8.0.0.201106081058 When there's a comma in a function parameter list that is not separating function parameters and the function parameter line wrapping policy is something other than "do not wrap", the commas that separate function parameters wrap instead of remaining on the line of the previous parameter. For example, this is the result of formatting with a "do not wrap" function parameter line wrapping policy: void do_not_wrap(more_than_one_template_argument_t<int, float> p1, no_template_arguments_t p2, no_template_arguments_t p3) { } Here is the result of formatting with the "wrap only when necessary" policy: void wrap_when_necessary(more_than_one_template_argument_t<int, float> p1 , no_template_arguments_t p2, no_template_arguments_t p3) { } Reproducible: Always Steps to Reproduce: 1. Create function whose declaration or definition exceeds the maximum line length. 2. Set the line wrapping policy of function parameters to something other than "do not wrap". 3. Run formatter.