1 This directory contains a VSPackage project to generate a Visual Studio extension
\r
4 Build prerequisites are:
\r
6 - Extensions SDK (you'll be prompted to install it if you open ClangFormat.sln)
\r
8 The extension is built using CMake to generate the usual LLVM.sln by setting
\r
9 the following CMake vars:
\r
11 - BUILD_CLANG_FORMAT_VS_PLUGIN=ON
\r
13 - NUGET_EXE_DIR=path/to/nuget_dir (unless nuget.exe is already available in PATH)
\r
17 mkdir build & cd build
\r
18 cmake -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DNUGET_EXE_DIR=C:\nuget ..
\r
20 Once LLVM.sln is generated, build the clang_format_vsix target, which will build
\r
21 ClangFormat.sln, the C# extension application.
\r
23 The CMake build will copy clang-format.exe and LICENSE.TXT into the ClangFormat/
\r
24 directory so they can be bundled with the plug-in, as well as creating
\r
25 ClangFormat/source.extension.vsixmanifest. Once the plug-in has been built with
\r
26 CMake once, it can be built manually from the ClangFormat.sln solution in Visual
\r
33 Once you've built the clang_format_vsix project from LLVM.sln at least once,
\r
34 open ClangFormat.sln in Visual Studio, then:
\r
36 - Make sure the "Debug" target is selected
\r
37 - Open the ClangFormat project properties
\r
38 - Select the Debug tab
\r
39 - Set "Start external program:" to where your devenv.exe is installed. Typically
\r
40 it's "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe"
\r
41 - Set "Command line arguments" to: /rootsuffix Exp
\r
42 - You can now set breakpoints if you like
\r
43 - Press F5 to build and run with debugger
\r
45 If all goes well, a new instance of Visual Studio will be launched in a special
\r
46 mode where it uses the experimental hive instead of the normal configuration hive.
\r
47 By default, when you build a VSIX project in Visual Studio, it auto-registers the
\r
48 extension in the experimental hive, allowing you to test it. In the new Visual Studio
\r
49 instance, open or create a C++ solution, and you should now see the Clang Format
\r
50 entries in the Tool menu. You can test it out, and any breakpoints you set will be
\r
51 hit where you can debug as usual.
\r