forked from OSchip/llvm-project
36e979af73
"main include" that will be the 1st include (category 0). Because the clang-format visual studio extension does not pass the file name and use the standard input, sort include cannot find a "main include": Testing fix on llvm\tools\clang\lib\Format\Format.cpp: Original file: #include "clang/Format/Format.h" ... #include "clang/Basic/SourceManager.h" #include "clang/Lex/Lexer.h" Without fix, selecting the includes and running visual studio clang-format: ... #include "clang/Basic/SourceManager.h" #include "clang/Format/Format.h" #include "clang/Lex/Lexer.h" With fix, selecting the includes and running visual studio clang-format: #include "clang/Format/Format.h" ... #include "clang/Basic/SourceManager.h" #include "clang/Lex/Lexer.h" Test 2 with main header not at the start: Original file: ... #include "clang/Format/Format.h" #include "clang/Basic/SourceManager.h" #include "clang/Lex/Lexer.h" Without fix, selecting the includes and running visual studio clang-format: ... #include "clang/Basic/SourceManager.h" #include "clang/Format/Format.h" #include "clang/Lex/Lexer.h" With fix, selecting the includes and running visual studio clang-format: #include "clang/Format/Format.h" ... #include "clang/Basic/SourceManager.h" #include "clang/Lex/Lexer.h" Patch by Jean-Philippe Dufraigne, thank you. Review: http://reviews.llvm.org/D16524 llvm-svn: 260378 |
||
---|---|---|
.. | ||
ClangFormat | ||
CMakeLists.txt | ||
ClangFormat.sln | ||
README.txt | ||
source.extension.vsixmanifest.in |
README.txt
This directory contains a VSPackage project to generate a Visual Studio extension for clang-format. Build prerequisites are: - Visual Studio 2013 Professional - Visual Studio 2013 SDK - Visual Studio 2010 Professional (?) - Visual Studio 2010 SDK (?) The extension is built using CMake by setting BUILD_CLANG_FORMAT_VS_PLUGIN=ON when configuring a Clang build, and building the clang_format_vsix target. The CMake build will copy clang-format.exe and LICENSE.TXT into the ClangFormat/ directory so they can be bundled with the plug-in, as well as creating ClangFormat/source.extension.vsixmanifest. Once the plug-in has been built with CMake once, it can be built manually from the ClangFormat.sln solution in Visual Studio.