1 //===--- CodeCompletionHandler.h - Preprocessor code completion -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the CodeCompletionHandler interface, which provides
11 // code-completion callbacks for the preprocessor.
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H
15 #define LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H
22 /// \brief Callback handler that receives notifications when performing code
23 /// completion within the preprocessor.
24 class CodeCompletionHandler {
26 virtual ~CodeCompletionHandler();
28 /// \brief Callback invoked when performing code completion for a preprocessor
31 /// This callback will be invoked when the preprocessor processes a '#' at the
32 /// start of a line, followed by the code-completion token.
34 /// \param InConditional Whether we're inside a preprocessor conditional
36 virtual void CodeCompleteDirective(bool InConditional) { }
38 /// \brief Callback invoked when performing code completion within a block of
39 /// code that was excluded due to preprocessor conditionals.
40 virtual void CodeCompleteInConditionalExclusion() { }
42 /// \brief Callback invoked when performing code completion in a context
43 /// where the name of a macro is expected.
45 /// \param IsDefinition Whether this is the definition of a macro, e.g.,
47 virtual void CodeCompleteMacroName(bool IsDefinition) { }
49 /// \brief Callback invoked when performing code completion in a preprocessor
50 /// expression, such as the condition of an \#if or \#elif directive.
51 virtual void CodeCompletePreprocessorExpression() { }
53 /// \brief Callback invoked when performing code completion inside a
54 /// function-like macro argument.
56 /// There will be another callback invocation after the macro arguments are
57 /// parsed, so this callback should generally be used to note that the next
58 /// callback is invoked inside a macro argument.
59 virtual void CodeCompleteMacroArgument(IdentifierInfo *Macro,
61 unsigned ArgumentIndex) { }
63 /// \brief Callback invoked when performing code completion in a part of the
64 /// file where we expect natural language, e.g., a comment, string, or
65 /// \#error directive.
66 virtual void CodeCompleteNaturalLanguage() { }
71 #endif // LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H