llvm-project/clang/unittests
mydeveloperday 70c98671fa [clang-format] Add option for not breaking line before ObjC params
Summary:
From `clang-format` version 3.7.0 and up, , there is no way to keep following format of ObjectiveC block:
```
- (void)_aMethod
{
    [self.test1 t:self w:self callback:^(typeof(self) self, NSNumber *u, NSNumber *v) {
        u = c;
    }]
}
```
Regardless of the change in `.clang-format` configuration file, all parameters will be lined up so that colons will be on the same column, like following:
```
- (void)_aMethod
{
    [self.test1 t:self
                w:self
         callback:^(typeof(self) self, NSNumber *u, NSNumber *v) {
             u = c;
         }]
}
```

Considering with ObjectiveC, the first code style is cleaner & more readable for some people, I've added a config option: `ObjCDontBreakBeforeNestedBlockParam` (boolean) so that if it is enable, the first code style will be favored.

Reviewed By: MyDeveloperDay

Patch By: ghvg1313

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D70926
2020-02-01 17:39:34 +00:00
..
AST [ASTMatchers] StringRef'ify hasName 2020-01-29 10:53:08 +01:00
ASTMatchers [ASTMatchers] Add hasPlacementArg and hasAnyPlacementArg traversal matcher for CXXNewExpr 2020-01-30 10:16:04 +00:00
Analysis [ASTMatchers] StringRef'ify hasName 2020-01-29 10:53:08 +01:00
Basic Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
CodeGen Removed PointerUnion3 and PointerUnion4 aliases in favor of the variadic template 2020-01-14 18:56:29 +01:00
CrossTU [Tooling] Migrated APIs that take ownership of objects to unique_ptr 2019-08-30 09:29:34 +00:00
DirectoryWatcher Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Driver [clang] Replace SmallStr.str().str() with std::string conversion operator. 2020-01-29 21:27:46 -08:00
Format [clang-format] Add option for not breaking line before ObjC params 2020-02-01 17:39:34 +00:00
Frontend [clang] Replace SmallStr.str().str() with std::string conversion operator. 2020-01-29 21:27:46 -08:00
Index Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Lex Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Rename Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Serialization [modules] Do not cache invalid state for modules that we attempted to load. 2020-01-16 17:12:41 -08:00
StaticAnalyzer [analyzer] CheckerContext: Make the Preprocessor available 2020-01-30 17:05:52 +01:00
Tooling Fix clang unnittest build with GCC 5 2020-01-29 10:30:36 +01:00
libclang Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
CMakeLists.txt [clang] [unittest] Import LLVMTestingSupport if necessary 2019-09-12 13:06:12 +00:00