diff options
| author | Manuel Klimek <klimek@google.com> | 2015-01-09 10:03:47 +0000 |
|---|---|---|
| committer | Manuel Klimek <klimek@google.com> | 2015-01-09 10:03:47 +0000 |
| commit | 949ff4d9f2eac092bce2e0d73f1262f829ae4d78 (patch) | |
| tree | d595a6642093a9145ae6b7ee00ad6fb95693387a /clang | |
| parent | aabcb80096e4e3dcbbb36a2c913d17ac3f7fcddc (diff) | |
| download | bcm5719-llvm-949ff4d9f2eac092bce2e0d73f1262f829ae4d78.tar.gz bcm5719-llvm-949ff4d9f2eac092bce2e0d73f1262f829ae4d78.zip | |
Add the shifted cursor position to XML output, so it can be used by editor integrations.
llvm-svn: 225516
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/tools/clang-format/ClangFormat.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp index cacc51fd977..d44d407aa86 100644 --- a/clang/tools/clang-format/ClangFormat.cpp +++ b/clang/tools/clang-format/ClangFormat.cpp @@ -229,6 +229,10 @@ static bool format(StringRef FileName) { if (OutputXML) { llvm::outs() << "<?xml version='1.0'?>\n<replacements xml:space='preserve'>\n"; + if (Cursor.getNumOccurrences() != 0) + llvm::outs() << "<cursor>" + << tooling::shiftedCodePosition(Replaces, Cursor) + << "</cursor>\n"; for (tooling::Replacements::const_iterator I = Replaces.begin(), E = Replaces.end(); I != E; ++I) { |

