Skip to content
Snippets Groups Projects
Commit 32a800c6 authored by Krasimir Georgiev's avatar Krasimir Georgiev
Browse files

[clang-format] Add text proto filename detection

Summary: Adds text proto filename detection.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D40120

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318525 91177308-0d34-0410-b5e6-96231b3b80d8
parent 91f4dd29
No related branches found
No related tags found
No related merge requests found
......@@ -2084,6 +2084,11 @@ static FormatStyle::LanguageKind getLanguageByFileName(StringRef FileName) {
if (FileName.endswith_lower(".proto") ||
FileName.endswith_lower(".protodevel"))
return FormatStyle::LK_Proto;
if (FileName.endswith_lower(".textpb") ||
FileName.endswith_lower(".pb.txt") ||
FileName.endswith_lower(".textproto") ||
FileName.endswith_lower(".asciipb"))
return FormatStyle::LK_TextProto;
if (FileName.endswith_lower(".td"))
return FormatStyle::LK_TableGen;
return FormatStyle::LK_Cpp;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment