15f757f3fSDimitry Andric //===----- CodeCompletion.h - Code Completion for ClangRepl ---===// 25f757f3fSDimitry Andric // 35f757f3fSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 45f757f3fSDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 55f757f3fSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 65f757f3fSDimitry Andric // 75f757f3fSDimitry Andric //===----------------------------------------------------------------------===// 85f757f3fSDimitry Andric // 95f757f3fSDimitry Andric // This file defines the classes which performs code completion at the REPL. 105f757f3fSDimitry Andric // 115f757f3fSDimitry Andric //===----------------------------------------------------------------------===// 125f757f3fSDimitry Andric 135f757f3fSDimitry Andric #ifndef LLVM_CLANG_INTERPRETER_CODE_COMPLETION_H 145f757f3fSDimitry Andric #define LLVM_CLANG_INTERPRETER_CODE_COMPLETION_H 155f757f3fSDimitry Andric #include <string> 165f757f3fSDimitry Andric #include <vector> 175f757f3fSDimitry Andric 185f757f3fSDimitry Andric namespace llvm { 195f757f3fSDimitry Andric class StringRef; 205f757f3fSDimitry Andric } // namespace llvm 215f757f3fSDimitry Andric 225f757f3fSDimitry Andric namespace clang { 235f757f3fSDimitry Andric class CodeCompletionResult; 245f757f3fSDimitry Andric class CompilerInstance; 255f757f3fSDimitry Andric 26*cb14a3feSDimitry Andric struct ReplCodeCompleter { 27*cb14a3feSDimitry Andric ReplCodeCompleter() = default; 28*cb14a3feSDimitry Andric std::string Prefix; 29*cb14a3feSDimitry Andric 30*cb14a3feSDimitry Andric /// \param InterpCI [in] The compiler instance that is used to trigger code 31*cb14a3feSDimitry Andric /// completion 32*cb14a3feSDimitry Andric 33*cb14a3feSDimitry Andric /// \param Content [in] The string where code completion is triggered. 34*cb14a3feSDimitry Andric 35*cb14a3feSDimitry Andric /// \param Line [in] The line number of the code completion point. 36*cb14a3feSDimitry Andric 37*cb14a3feSDimitry Andric /// \param Col [in] The column number of the code completion point. 38*cb14a3feSDimitry Andric 39*cb14a3feSDimitry Andric /// \param ParentCI [in] The running interpreter compiler instance that 40*cb14a3feSDimitry Andric /// provides ASTContexts. 41*cb14a3feSDimitry Andric 42*cb14a3feSDimitry Andric /// \param CCResults [out] The completion results. 435f757f3fSDimitry Andric void codeComplete(CompilerInstance *InterpCI, llvm::StringRef Content, 44*cb14a3feSDimitry Andric unsigned Line, unsigned Col, 45*cb14a3feSDimitry Andric const CompilerInstance *ParentCI, 465f757f3fSDimitry Andric std::vector<std::string> &CCResults); 47*cb14a3feSDimitry Andric }; 485f757f3fSDimitry Andric } // namespace clang 495f757f3fSDimitry Andric #endif 50