kadircet added inline comments.

================
Comment at: clang-tools-extra/clangd/refactor/InsertionPoint.cpp:51
+    } else {
+      assert(A.Direction == Anchor::Below);
+      if (LastMatched && !Matches)
----------------
nit: use a switch?


================
Comment at: clang-tools-extra/clangd/refactor/InsertionPoint.cpp:134
+  // Fallback: insert at the end of the class. Check if protection matches!
+  if (Loc.isInvalid()) {
+    Loc = InClass.getBraceRange().getEnd();
----------------
what if we had:
```
class Foo {
public:
  void foo();
};
```

and wanted to insert a `private` member/field?
I suppose we should check for the specifier of last decl in `InClass` instead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116502/new/

https://reviews.llvm.org/D116502

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to