Commit 6dbd4bb 1 parent a9111d4 commit 6dbd4bb Copy full SHA for 6dbd4bb
File tree 4 files changed +8
-3
lines changed
4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code.
54
54
Objective-C: .m .mm
55
55
Proto: .proto .protodevel
56
56
TableGen: .td
57
- TextProto: .textpb .pb.txt .textproto .asciipb
57
+ TextProto: .txtpb . textpb .pb.txt .textproto .asciipb
58
58
Verilog: .sv .svh .v .vh
59
59
--cursor=<uint> - The position of the cursor when invoking
60
60
clang-format from an editor integration
Original file line number Diff line number Diff line change @@ -3891,7 +3891,11 @@ static FormatStyle::LanguageKind getLanguageByFileName(StringRef FileName) {
3891
3891
FileName.ends_with_insensitive (" .protodevel" )) {
3892
3892
return FormatStyle::LK_Proto;
3893
3893
}
3894
- if (FileName.ends_with_insensitive (" .textpb" ) ||
3894
+ // txtpb is the canonical extension, and textproto is the legacy canonical
3895
+ // extension
3896
+ // https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files
3897
+ if (FileName.ends_with_insensitive (" .txtpb" ) ||
3898
+ FileName.ends_with_insensitive (" .textpb" ) ||
3895
3899
FileName.ends_with_insensitive (" .pb.txt" ) ||
3896
3900
FileName.ends_with_insensitive (" .textproto" ) ||
3897
3901
FileName.ends_with_insensitive (" .asciipb" )) {
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ config.suffixes = [
12
12
" .proto" ,
13
13
" .protodevel" ,
14
14
" .pb.txt" ,
15
+ " .txtpb" ,
15
16
" .textproto" ,
16
17
" .textpb" ,
17
18
" .asciipb" ,
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ static cl::opt<std::string> AssumeFileName(
92
92
" Objective-C: .m .mm\n "
93
93
" Proto: .proto .protodevel\n "
94
94
" TableGen: .td\n "
95
- " TextProto: .textpb .pb.txt .textproto .asciipb\n "
95
+ " TextProto: .txtpb . textpb .pb.txt .textproto .asciipb\n "
96
96
" Verilog: .sv .svh .v .vh" ),
97
97
cl::init(" <stdin>" ), cl::cat(ClangFormatCategory));
98
98
You can’t perform that action at this time.
0 commit comments