Issue: when SortIncludes option is enabled, the plugin incorrectly sorts includes in .cpp files. This is caused by the fact that clang-format is invoked on a temporary file which is named by appending .trvs extension to the original file name. File name change prevents clang-format to correctly determine the main header for a source file and put it on top of includes list.
Fix: preserve original file name and copy the file to a temporary directory ClangFormatXcodeTmpDir inside original directory.
Issue: when
SortIncludes
option is enabled, the plugin incorrectly sorts includes in.cpp
files. This is caused by the fact thatclang-format
is invoked on a temporary file which is named by appending.trvs
extension to the original file name. File name change preventsclang-format
to correctly determine the main header for a source file and put it on top of includes list.Fix: preserve original file name and copy the file to a temporary directory
ClangFormatXcodeTmpDir
inside original directory.