[clang-format][NFC] Upgrade SortIncludes option to a struct (#140497)
This allows adding other suboptions e.g. IgnoreExtension in #137840.
NOKEYCHECK=True
GitOrigin-RevId: 5ddcd765dbb088b3fe8eb09dd38db1252981962c
diff --git a/ClangFormat.cpp b/ClangFormat.cpp
index c45e3a2..08fe95f 100644
--- a/ClangFormat.cpp
+++ b/ClangFormat.cpp
@@ -478,10 +478,9 @@
}
if (SortIncludes.getNumOccurrences() != 0) {
+ FormatStyle->SortIncludes = {};
if (SortIncludes)
- FormatStyle->SortIncludes = FormatStyle::SI_CaseSensitive;
- else
- FormatStyle->SortIncludes = FormatStyle::SI_Never;
+ FormatStyle->SortIncludes.Enabled = true;
}
unsigned CursorPosition = Cursor;
Replacements Replaces = sortIncludes(*FormatStyle, Code->getBuffer(), Ranges,