From: Daniel Jasper Date: Fri, 8 May 2015 15:36:30 +0000 (+0000) Subject: clang-format: Only output IncompleteFormat if -cursor is given. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=199217c454a55a6edb9aac735fe073a591968ffa;p=clang clang-format: Only output IncompleteFormat if -cursor is given. This is only for editor integrations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236867 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Format/incomplete.cpp b/test/Format/incomplete.cpp index ade38b66a3..b66d5f816e 100644 --- a/test/Format/incomplete.cpp +++ b/test/Format/incomplete.cpp @@ -1,7 +1,7 @@ // RUN: grep -Ev "// *[A-Z-]+:" %s > %t2.cpp // RUN: clang-format -style=LLVM %t2.cpp > %t.cpp -// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s -// CHECK: {{^\{ "IncompleteFormat": true }} +// RUN: FileCheck -strict-whitespace -cursor=0 -input-file=%t.cpp %s +// CHECK: {{"IncompleteFormat": true}} // CHECK: {{^int\ \i;$}} int i; // CHECK: {{^f \( g \(;$}} diff --git a/tools/clang-format/ClangFormat.cpp b/tools/clang-format/ClangFormat.cpp index ae2180c837..5037e901f3 100644 --- a/tools/clang-format/ClangFormat.cpp +++ b/tools/clang-format/ClangFormat.cpp @@ -226,7 +226,8 @@ static bool format(StringRef FileName) { FormatStyle FormatStyle = getStyle( Style, (FileName == "-") ? AssumeFilename : FileName, FallbackStyle); bool IncompleteFormat = false; - tooling::Replacements Replaces = reformat(FormatStyle, Sources, ID, Ranges, &IncompleteFormat); + tooling::Replacements Replaces = + reformat(FormatStyle, Sources, ID, Ranges, &IncompleteFormat); if (OutputXML) { llvm::outs() << "\n