Task: Add Feature To Eclipse CDT Formatter
Posted: Thu Jan 31, 2013 12:03 pm
There are a couple of minor issues with the CDT code formatter in Juno SR1 + performance patch:
1) It screws with blank lines, make this optional, or for our purposes, just make it not screw with them at all. Optional is an upstreamable patch, but more work, as you need to make a new tab for it. JDT has this feature, so checking their code base could be helpful - I didn't look there yet, though.
2) If a macro with args is included in a block of math, it puts a trailing space after it, however not after a function in the same place, nor a literal in the same place, nor a var in the same place, etc. This is a bug IMO, and I should likely file it on eclipse CDT, but maybe with a patch.
These files (at least) have the code in them:
The formatter definition and/or patch needs to work well in order to not piss everyone off who wants to include code in the firmware. This would be a useful contribution to a HUGE project (eclipse), and to this one, as well.
Any takers?
Fred.
1) It screws with blank lines, make this optional, or for our purposes, just make it not screw with them at all. Optional is an upstreamable patch, but more work, as you need to make a new tab for it. JDT has this feature, so checking their code base could be helpful - I didn't look there yet, though.
2) If a macro with args is included in a block of math, it puts a trailing space after it, however not after a function in the same place, nor a literal in the same place, nor a var in the same place, etc. This is a bug IMO, and I should likely file it on eclipse CDT, but maybe with a patch.
These files (at least) have the code in them:
Code: Select all
find ~/workspace/org.eclipse.cdt/ -type d -and -name formatter
/home/fred/workspace/org.eclipse.cdt/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter
/home/fred/workspace/org.eclipse.cdt/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter
/home/fred/workspace/org.eclipse.cdt/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter
/home/fred/workspace/org.eclipse.cdt/core/org.eclipse.cdt.ui.tests/resources/formatter
Any takers?
Fred.