[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


================
@@ -3786,9 +3800,8 @@ tooling::Replacements sortJavaImports(const FormatStyle &Style, StringRef Code,
       ImportsInBlock.push_back(
           {Identifier, Line, Prev, AssociatedCommentLines, IsStatic});
       AssociatedCommentLines.clear();
----------------
owenca wrote:

```suggestion
      HasImport = true;
      AssociatedCommentLines.clear();
```

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


More information about the cfe-commits mailing list