djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land.
Just a few minor comments, otherwise looks good. ================ Comment at: lib/Format/Format.cpp:1542 +bool likelyXml(StringRef Code) { + return Code.ltrim().startswith("<"); ---------------- Rename to isLikelyXml. ================ Comment at: lib/Format/Format.cpp:1552 return Replaces; - if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript && - isMpegTS(Code)) + if (likelyXml(Code) || + (Style.Language == FormatStyle::LanguageKind::LK_JavaScript && ---------------- Just add a separate if statement. Or merge with previous one, but I think three separate if statements is actually easiest to read. ================ Comment at: lib/Format/Format.cpp:1902 return tooling::Replacements(); - if (Expanded.Language == FormatStyle::LK_JavaScript && isMpegTS(Code)) + if (likelyXml(Code) || + (Expanded.Language == FormatStyle::LK_JavaScript && isMpegTS(Code))) ---------------- Same here. https://reviews.llvm.org/D37136 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits