[clang] [clang-format] java import sorting should ignore imports in comments and text blocks (PR #177326)

via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 8 00:22:34 PST 2026


================
@@ -3755,6 +3754,7 @@ tooling::Replacements sortJavaImports(const FormatStyle &Style, StringRef Code,
   unsigned Prev = 0;
   unsigned SearchFrom = 0;
----------------
owenca wrote:

```suggestion
  bool HasImport = false;
```
We don't need both `Prev` and `SearchFrom`.

https://github.com/llvm/llvm-project/pull/177326


More information about the cfe-commits mailing list