[cfe-dev] [clang-format] Sort include does not handle pre-compiled headers well.
Jean-philippe Dufraigne via cfe-dev
cfe-dev at lists.llvm.org
Sun Dec 6 10:17:43 PST 2015
Sorry, I sent the initial message to the wrong list.
When using pre-compiled header, the Main Header for the file will not be
detected since the first header needs to be the precompiled header.
I was looking at fixing it, but I am not quite sure how to go fixing it?
This will result in the main header being moved.
This can be somewhat worked around by leaving a line after the Main Header.
Fix Option 1:
Add a new option: PercompiledHeaderRegEx, and if detected assign priority
-1, and keep on looking for MainHeader (Not great since we use unsigned)
Fix Option 2:
Add a keyword that can be used instead of the regular expression to refer
to the MainHeader. This way one can add a regular expression for the
pre-compiled header priority 0, and one for MainHeader priority 1. Consider
it main header if first header with category >= MainHeaderCategory.
Fix Option 3:
A better plan?
Do you have any thought on the problem?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev