clang-format.exe removes trailing new lines at end of file.
However, if no NL is found at EOF one should be added.
Patch by Teodor MICU!
Differential Revision: https://reviews.llvm.org/D37732
llvm-svn: 314033
We're moving the extension to a new account on the VS Marketplace, and
apparently it's not possible to re-upload an extension with an existing
ID on a new account.
llvm-svn: 313060
With the new release of VS, it's required that all plugins migrate to
the new VSIX manifest format. The new format is backwards compatible
with all versions newer that Visual Studio 2012, so this migration
effectively drops support for older versions of the IDE.
It's also required that these new extensions are built with Visual
Studio 2017, so unfortunately it was necessary to migrate the project
and solution. Also removed COM references to EnvDTE and
Microsoft.VisualStudio.TextManager.Interop from the csproj, as they seem
to both be unnecessary and would trigger build warnings because of
changes to GAC.
Patch by Hugo Puhlmann!
Differential Revision: https://reviews.llvm.org/D31740
llvm-svn: 300225
This change adds a feature to the clang-format VS extension that optionally
enables the automatic formatting of documents when saving. Since developers
always need to save their files, this eases the workflow of making sure source
files are properly formatted.
Differential Revision: https://reviews.llvm.org/D29221
llvm-svn: 299543
Bound to Ctrl+R, Ctrl+D by default. Also added section on how to debug the extension to the Readme.
Differential Revision: https://reviews.llvm.org/D27501
llvm-svn: 289910
Presently, the version number of the VSIX matches the LLVM version number. However, as this number doesn't change often, it means that as we release new versions of this VSIX, it will have the same version number, which means users must first uninstall the old version before installing the new one. With this change, we generate a 4th part to the version number that is a date stamp (year, month, day); for example: 4.0.0.161203.
Differential Revision: https://reviews.llvm.org/D27438
llvm-svn: 289909
"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
The plugin still works fine in versions starting from 2010,
but this was needed to make the project _build_ in VS 2013, which
is the blessed version for building LLVM projects these days.
http://reviews.llvm.org/D8021
llvm-svn: 231084
The vsix installer will show the license when it starts, and it
would print an annoying message when there was none.
While we're here, add a MoreInfoUrl.
llvm-svn: 214237
Previously it was hard-coded to 1.0, which meant the installer would
not install the plugin over previous versions.
This commit makes us use LLVM's major.minor.patch version from cmake,
or whatever CLANG_FORMAT_VS_VERSION is set to when configuring the build.
It's pretty dirty to update a configuration file in the source directory
from the cmake build like this. However, the plugin build is already
dirty in this regard since it builds in the source dir when visual studio,
and then copies out the resulting vsix.
llvm-svn: 213584
as the location for grabbing clang-format.exe, and also output the .vsix here.
This allows us to find clang-format.exe when building from a MSVC Solution.
llvm-svn: 196512
This makes it possible to build the clang-format vs plugin from the cmake build.
It is a hack, as it shells out to "devenv" to actually build it, but it's hidden
away in a corner behind a flag, and it provides a convenient way of building the
plug-in from the command-line together with the rest of clang.
Differential Revision: http://llvm-reviews.chandlerc.com/D2310
llvm-svn: 196299
This makes the clang-format plugin self-contained. Instead of
requiring clang-format.exe to be available on the PATH, this
includes it in the plugin's installer (.vsix file) and runs it
from the install directory.
Differential Revision: http://llvm-reviews.chandlerc.com/D2281
llvm-svn: 196122
This matches other README.txt files in LLVM and makes things more obvious on
Windows where it's likely to be read. CRLFs are retained for the same reason.
Also fix Visual Studio product name.
llvm-svn: 195420
Dotfiles are impractical on Windows. This makes clang-format search
for the style configuration file as '_clang-format' in addition to
the usual '.clang-format'. This is similar to how VIM searches for
'_vimrc' on Windows.
Differential Revision: http://llvm-reviews.chandlerc.com/D1629
llvm-svn: 190413