summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-format-vs/ClangFormat
Commit message (Collapse)AuthorAgeFilesLines
* clang-format-vs : Fix Unicode formattingHans Wennborg2019-11-271-11/+20
| | | | | | | | | | | | | | | | Use UTF-8 for communication with clang-format and convert the replacements offset/length to characters position/count. Internally VisualStudio.Text.Editor.IWpfTextView use sequence of Unicode characters encoded using UTF-16 and use characters position/count for manipulating text. Resolved "Error while running clang-format: Specified argument was out of the range of valid values. Parameter name: replaceSpan". Patch by empty2fill! Differential revision: https://reviews.llvm.org/D70633
* Fix typos throughout the license files that somehow I and my reviewersChandler Carruth2019-01-211-1/+1
| | | | | | | | | | | all missed! Thanks to Alex Bradbury for pointing this out, and the fact that I never added the intended `legacy` anchor to the developer policy. Add that anchor too. With hope, this will cause the links to all resolve successfully. llvm-svn: 351731
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Update some code used in our visual studio plugins to use linux fileChandler Carruth2019-01-193-458/+458
| | | | | | | | endings. We already used them in some cases, and this makes things consistent. This will also simplify updating the licenses in these files. llvm-svn: 351632
* Install new LLVM license structure and new developer policy.Chandler Carruth2019-01-191-16/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This installs the new developer policy and moves all of the license files across all LLVM projects in the monorepo to the new license structure. The remaining projects will be moved independently. Note that I've left odd formatting and other idiosyncracies of the legacy license structure text alone to make the diff easier to read. Critically, note that we do not in any case *remove* the old license notice or terms, as that remains necessary until we finish the relicensing process. I've updated a few license files that refer to the LLVM license to instead simply refer generically to whatever license the LLVM project is under, basically trying to minimize confusion. This is really the culmination of so many people. Chris led the community discussions, drafted the policy update and organized the multi-year string of meeting between lawyers across the community to figure out the strategy. Numerous lawyers at companies in the community spent their time figuring out initial answers, and then the Foundation's lawyer Heather Meeker has done *so* much to help refine and get us ready here. I could keep going on, but I just want to make sure everyone realizes what a huge community effort this has been from the begining. Differential Revision: https://reviews.llvm.org/D56897 llvm-svn: 351631
* Update copyright year to 2018.Paul Robinson2018-06-181-1/+1
| | | | llvm-svn: 334936
* clang-format plugin: Add missing semicolon in list of file extensions (PR36383)Hans Wennborg2018-02-201-1/+1
| | | | llvm-svn: 325566
* clang-format plugin: Add missing NL (new line) at EOF (end of file)Hans Wennborg2017-09-221-0/+6
| | | | | | | | | | | | 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
* clang-format-vs licence.txt: drop svn:executableHans Wennborg2017-04-131-0/+0
| | | | | | Not sure how it ended up with that property in the first place. llvm-svn: 300245
* Follow-up to r300225: update ClangFormat.csproj tooHans Wennborg2017-04-131-1/+1
| | | | llvm-svn: 300231
* Warning-free clang-format plugin install for VS 15.0Hans Wennborg2017-04-132-45/+8
| | | | | | | | | | | | | | | | | | | | 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
* clang-format-vs: Use a separate license.txt copyHans Wennborg2017-04-131-0/+39
| | | | | | | The regular file used to display very poorly in the VSIX installer due to long lines, wrapping etc. llvm-svn: 300223
* clang-format-vsix: Add "Format on Save" featureAntonio Maiorano2017-04-054-90/+279
| | | | | | | | | | | 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
* clang-format-vsix: add command to format documentAntonio Maiorano2016-12-163-19/+94
| | | | | | | | 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
* Fix VS2015 build of clang-format-vsix by using NuGet to pull in required ↵Hans Wennborg2016-12-012-17/+103
| | | | | | | | | | assemblies Also added a gitignore to help track the right items to commit. Patch by Antonio Maiorano <amaiorano@gmail.com>! llvm-svn: 288393
* clang-format VS plugin: upgrade the project files to VS2015Hans Wennborg2016-09-152-3/+3
| | | | | | | The plugin itself runs on previous VS versions, but this enables it to be built with VS2015. llvm-svn: 281648
* clang-format sort include use the source file name to determine theDaniel Jasper2016-02-101-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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
* Added new options to ClangFormat VSIX package.Marek Kurdej2015-10-192-7/+142
| | | | | | | | | | | | | | | | | | | Summary: Added new options to ClangFormat VSIX package: * fallback-style * assume-filename * sort-includes. Changed version to 1.1 (otherwise one couldn't update). Fixed clang-format escaping of XML reserved characters. Reviewers: hans, aaron.ballman, klimek, rnk, zturner Subscribers: djasper, cfe-commits Differential Revision: http://reviews.llvm.org/D13549 llvm-svn: 250694
* Migrate clang-format-vs plugin project to VS 2013Hans Wennborg2015-03-032-6/+3
| | | | | | | | | | 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
* clang-format vs plugin: include the licenseHans Wennborg2014-07-291-1/+4
| | | | | | | | | 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
* clang-format vs plugin: set version number from cmake (PR20307)Hans Wennborg2014-07-211-31/+0
| | | | | | | | | | | | | | | 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
* ClangFormatPackage.cs: fix inconsistent line endingsHans Wennborg2013-12-021-1/+1
| | | | llvm-svn: 196131
* clang-format vs plugin: use Alp's suggestion for getting the pathHans Wennborg2013-12-021-2/+2
| | | | llvm-svn: 196124
* clang-format vs plugin: bake clang-format.exe into the vsixHans Wennborg2013-12-022-1/+8
| | | | | | | | | | | 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
* Upgrade the VS solution to 2012.Manuel Klimek2013-11-122-4/+52
| | | | | | Now we can compile a VSPackage that works with VS 2010-2013 from within VS 2012. llvm-svn: 194488
* Fix key bindings for VS 2010.Manuel Klimek2013-11-121-4/+5
| | | | | | | Set the default key-binding only in the text editor; the global binding of ctrl-r,ctrl-f was already taken in VS 2010. llvm-svn: 194482
* Recreated the ClangFormat VSPackage with VS 2010.Manuel Klimek2013-11-126-43/+44
| | | | | | The generated package is now compatible with VS 2010 - 2013. llvm-svn: 194480
* Revert unintentional commit from r194477.Manuel Klimek2013-11-124-46/+60
| | | | llvm-svn: 194478
* (no commit message)Manuel Klimek2013-11-124-60/+46
| | | | llvm-svn: 194477
* Allow _clang-format as alternative to .clang-format config filenameHans Wennborg2013-09-101-3/+4
| | | | | | | | | | | 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
* Make error text if clang-format is not on the system PATH more helpful,Manuel Klimek2013-09-051-1/+10
| | | | | | | as this is going to be a common mistake (installing LLVM defaults to not putting the tools onto the PATH). llvm-svn: 190036
* Adds a VSPackage project that builds a VS extension to run clang-format over ↵Manuel Klimek2013-09-0413-0/+933
a selection / the line at the cursor. llvm-svn: 189955
OpenPOWER on IntegriCloud