kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land.
thanks, LGTM ================ Comment at: clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp:158 + + if (MustInsertAfterLoc.isValid() && + SM.isBeforeInTranslationUnit(U->getUsingLoc(), MustInsertAfterLoc)) ---------------- why not check for this below? as usings are sorted, we expect `LastUsingLoc` to be after this point. so maybe change the `if` below to: `if(LastUsingLoc.isValid() && (!MustInsertAfterLoc.isValid() || SM.isBeforeInTranslationUnit(MustInsertAfterLoc, LastUsingLoc)))` ================ Comment at: clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp:201 + for (const auto &TLD : TLDs) { + if (MustInsertAfterLoc.isValid() && + SM.isBeforeInTranslationUnit(TLD->getBeginLoc(), MustInsertAfterLoc)) ---------------- nit: maybe factor this into a lambda `bool IsUsingValidAt(SourceLocation)` ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92053/new/ https://reviews.llvm.org/D92053 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits