[PATCH] D154382: [ClangRepl] support code completion at a REPL

Fred Fu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 13 07:47:00 PDT 2023


capfredf added inline comments.


================
Comment at: clang/lib/Interpreter/CodeCompletion.cpp:102
+  std::vector<CodeCompletionResult> Results;
+  auto *CConsumer = new ReplCompletionConsumer(Results);
+  auto Interp = Interpreter::createForCodeCompletion(
----------------
v.g.vassilev wrote:
> Let's move this in `Interpreter::createForCodeCompletion`.
The reasons I moved this out of `Interpreter::createForCodeCompletion` are 
1. Design-wise, we don't need to expose `ReplCompletionConsumer` to `Interpreter.cpp`. All `createForCodeCompletion` needs is a subclass instance of `CodeCompletionConsumer`. 
2. ReplCompletionConsumer has more data members on the type-directed branch than the one on this branch. I'd rather create an instance here than pass all the necessary arguments to one layer down and do that there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154382



More information about the cfe-commits mailing list