[clang] [ClangRepl] Type Directed Code Completion (PR #67349)
Vassil Vassilev via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 14 11:09:13 PST 2023
================
@@ -56,26 +63,146 @@ class ReplCompletionConsumer : public CodeCompleteConsumer {
std::shared_ptr<GlobalCodeCompletionAllocator> CCAllocator;
CodeCompletionTUInfo CCTUInfo;
std::vector<std::string> &Results;
+ ReplCodeCompleter &CC;
+};
+
+// The class CompletionContextHandler contains four interfaces, each of
+// which handles one type of completion result.
+// Its substract classes are used to create concrete handlers based on
+// CodeCompletionContext.
+class CompletionContextHandler {
+protected:
+ CodeCompletionContext CCC;
+ std::vector<std::string> &Results;
+
+private:
+ Sema &S;
+
+public:
+ CompletionContextHandler(Sema &S, CodeCompletionContext CCC,
+ std::vector<std::string> &Results)
+ : CCC(CCC), Results(Results), S(S) {}
+
+ // converts a Declaration completion result to a completion string, and then
+ // stores it in Results.
----------------
vgvassilev wrote:
```suggestion
/// Converts a Declaration completion result to a completion string, and then
/// stores it in Results.
```
https://github.com/llvm/llvm-project/pull/67349
More information about the cfe-commits
mailing list