kadircet added inline comments.

================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:407
+    // reference the declaration.
+    if (ContextKind == CodeCompletionContext::CCC_ObjCClassForwardDecl)
+      ShouldInsert = false;
----------------
rather than doing this here, can you pass `ContextKind` into 
`headerToInsertIfAllowed` ? we already have some logic there that does 
something similar (e.g. check if there's a decl in the main file). it'd be nice 
to group them together, in case we want to extend this in the future. (it'd be 
great if we can just have a `contextAllowsHeaderInsertion` helper, which can 
only return true for ObjCClassForwardDecl for now).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150978

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

Reply via email to