|
@@ -618,9 +618,9 @@ static FormatStyle expandPresets(const FormatStyle &Style) {
|
|
return Expanded;
|
|
return Expanded;
|
|
}
|
|
}
|
|
|
|
|
|
-FormatStyle getLLVMStyle() {
|
|
|
|
|
|
+FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) {
|
|
FormatStyle LLVMStyle;
|
|
FormatStyle LLVMStyle;
|
|
- LLVMStyle.Language = FormatStyle::LK_Cpp;
|
|
|
|
|
|
+ LLVMStyle.Language = Language;
|
|
LLVMStyle.AccessModifierOffset = -2;
|
|
LLVMStyle.AccessModifierOffset = -2;
|
|
LLVMStyle.AlignEscapedNewlines = FormatStyle::ENAS_Right;
|
|
LLVMStyle.AlignEscapedNewlines = FormatStyle::ENAS_Right;
|
|
LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align;
|
|
LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align;
|
|
@@ -729,8 +729,7 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
|
|
return GoogleStyle;
|
|
return GoogleStyle;
|
|
}
|
|
}
|
|
|
|
|
|
- FormatStyle GoogleStyle = getLLVMStyle();
|
|
|
|
- GoogleStyle.Language = Language;
|
|
|
|
|
|
+ FormatStyle GoogleStyle = getLLVMStyle(Language);
|
|
|
|
|
|
GoogleStyle.AccessModifierOffset = -1;
|
|
GoogleStyle.AccessModifierOffset = -1;
|
|
GoogleStyle.AlignEscapedNewlines = FormatStyle::ENAS_Left;
|
|
GoogleStyle.AlignEscapedNewlines = FormatStyle::ENAS_Left;
|
|
@@ -2344,8 +2343,7 @@ llvm::Expected<FormatStyle> getStyle(StringRef StyleName, StringRef FileName,
|
|
if (!FS) {
|
|
if (!FS) {
|
|
FS = llvm::vfs::getRealFileSystem().get();
|
|
FS = llvm::vfs::getRealFileSystem().get();
|
|
}
|
|
}
|
|
- FormatStyle Style = getLLVMStyle();
|
|
|
|
- Style.Language = guessLanguage(FileName, Code);
|
|
|
|
|
|
+ FormatStyle Style = getLLVMStyle(guessLanguage(FileName, Code));
|
|
|
|
|
|
FormatStyle FallbackStyle = getNoStyle();
|
|
FormatStyle FallbackStyle = getNoStyle();
|
|
if (!getPredefinedStyle(FallbackStyleName, Style.Language, &FallbackStyle))
|
|
if (!getPredefinedStyle(FallbackStyleName, Style.Language, &FallbackStyle))
|