| Summary: | Provide @formatter:off to the CDT code formatter | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Sharon Dagan <sharon.dagan> |
| Component: | cdt-editor | Assignee: | Project Inbox <cdt-editor-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | Anton Leherbauer <aleherb+eclipse> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, marc.khouzam, oxoxon, waav_zoungla-efc7, zeratul976 |
| Version: | Next | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Sharon Dagan
I need this feature too. When I have the following code formatted for example, I get an unwilling result which is difficult to understand the structure of the bit operations in the code.
--- Before ---
CI[ 5] = D[13] ^ D[12] ^ D[11] ^ D[ 9] ^ D[ 8] ^ D[ 5] ^ D[ 4] ^ D[ 0] ^
C[ 0] ^ C[ 4] ^ C[ 5] ^ C[ 8] ^ C[ 9] ^ C[11] ^ C[12] ^ C[13];
CI[ 6] = D[14] ^ D[13] ^ D[12] ^ D[10] ^ D[ 9] ^ D[ 6] ^ D[ 5] ^ D[ 1] ^
C[ 1] ^ C[ 5] ^ C[ 6] ^ C[ 9] ^ C[10] ^ C[12] ^ C[13] ^ C[14];
--- After ---
CI[5] = D[13] ^ D[12] ^ D[11] ^ D[9] ^ D[8] ^ D[5] ^ D[4] ^ D[0] ^ C[0]
^ C[4] ^ C[5] ^ C[8] ^ C[9] ^ C[11] ^ C[12] ^ C[13];
CI[6] = D[14] ^ D[13] ^ D[12] ^ D[10] ^ D[9] ^ D[6] ^ D[5] ^ D[1] ^ C[1]
^ C[5] ^ C[6] ^ C[9] ^ C[10] ^ C[12] ^ C[13] ^ C[14];
Here is another example. The difference between 4 lines become unclear after formatting.
--- Before ---
if (asic == 0) {
WriteRegisterPartially(0x4D, channel, channel, enable ? 0x1 : 0x0);
} else if (asic == 1) {
WriteRegisterPartially(0x4D, channel + 16, channel + 16, enable ? 0x1 : 0x0);
} else if (asic == 2) {
WriteRegisterPartially(0x4E, channel, channel, enable ? 0x1 : 0x0);
} else if (asic == 3) {
WriteRegisterPartially(0x4E, channel + 16, channel + 16, enable ? 0x1 : 0x0);
}
--- After ---
if (asic == 0) {
WriteRegisterPartially(0x4D, channel, channel, enable ? 0x1 : 0x0);
} else if (asic == 1) {
WriteRegisterPartially(0x4D, channel + 16, channel + 16,
enable ? 0x1 : 0x0);
} else if (asic == 2) {
WriteRegisterPartially(0x4E, channel, channel, enable ? 0x1 : 0x0);
} else if (asic == 3) {
WriteRegisterPartially(0x4E, channel + 16, channel + 16,
enable ? 0x1 : 0x0);
}
This is essentially a duplicate of bug 327559, it's just a different syntax being asked for (@formatter:off vs. *INDENT-OFF*). Would it be appropriate then that someone who has the rights/permissions to do this flags this bug entry as a duplicate of #327559? I'm asking because I am putting all of my votes on this feature request. (In reply to Amenel Voglozin from comment #3) > Would it be appropriate then that someone who has the rights/permissions to > do this flags this bug entry as a duplicate of #327559? Yes. (I don't.) > I'm asking because I am putting all of my votes on this feature request. You're welcome to do that, but given that this feature request has been open for almost 5 years and no one has implemented it yet, voting for it is not likely to have much effect. If you really want this feature, a more effective way to get it would be to contribute a patch that implements it yourself. (In reply to Nathan Ridge from comment #2) > This is essentially a duplicate of bug 327559, it's just a different syntax > being asked for (@formatter:off vs. *INDENT-OFF*). *** This bug has been marked as a duplicate of bug 327559 *** |