sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Sorry about the delay :-(



================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1989
     CodeCompletion Item;
     Item.Name = Name.str() + "=";
     Item.Kind = CompletionItemKind::Text;
----------------
also here


================
Comment at: clang/include/clang/Sema/CodeCompleteConsumer.h:612
+  /// methods, can have multiple.
+  bool hasMultipleTypedTextChunks() const;
+
----------------
I'm not sure we should add this new API.
Our only use case so far is an optimization (over getAllTypedText) and it's not 
a great fit for this (it requires us to do two traversals of the CCS in the 
common case).
On the other hand an interface that avoids this is specialized.

Instead maybe just place the loop at the callsite in getName()?
```
const Chunk *OnlyText = nullptr;
for (Chunk &C : CCS) {
  if (!C is TypedText) continue;
  if (OnlyText) return CCS.getAllTypedText()
  OnlyText = &C;
}
return C ? C->Text : nullptr;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124637

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

Reply via email to