CodeCompletionHandler.h revision 1fbb447e9d43c2c676e94081fbfee7eb6cbe933b
1f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor//===--- CodeCompletionHandler.h - Preprocessor code completion -*- C++ -*-===// 2f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor// 3f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor// The LLVM Compiler Infrastructure 4f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor// 5f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor// This file is distributed under the University of Illinois Open Source 6f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor// License. See LICENSE.TXT for details. 7f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor// 8f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor//===----------------------------------------------------------------------===// 9f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor// 10f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor// This file defines the CodeCompletionHandler interface, which provides 11f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor// code-completion callbacks for the preprocessor. 12f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor// 13f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor//===----------------------------------------------------------------------===// 14f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor#ifndef LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H 15f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor#define LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H 16f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor 17f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregornamespace clang { 18f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor 19f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor/// \brief Callback handler that receives notifications when performing code 20f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor/// completion within the preprocessor. 21f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregorclass CodeCompletionHandler { 22f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregorpublic: 23f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor virtual ~CodeCompletionHandler(); 24f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor 25f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor /// \brief Callback invoked when performing code completion for a preprocessor 26f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor /// directive. 27f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor /// 28f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor /// This callback will be invoked when the preprocessor processes a '#' at the 29f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor /// start of a line, followed by the code-completion token. 30f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor /// 31f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor /// \param InConditional Whether we're inside a preprocessor conditional 32f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor /// already. 33f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor virtual void CodeCompleteDirective(bool InConditional) { } 34f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor 35f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor /// \brief Callback invoked when performing code completion within a block of 36f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor /// code that was excluded due to preprocessor conditionals. 37f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor virtual void CodeCompleteInConditionalExclusion() { } 381fbb447e9d43c2c676e94081fbfee7eb6cbe933bDouglas Gregor 391fbb447e9d43c2c676e94081fbfee7eb6cbe933bDouglas Gregor /// \brief Callback invoked when performing code completion in a context 401fbb447e9d43c2c676e94081fbfee7eb6cbe933bDouglas Gregor /// where the name of a macro is expected. 411fbb447e9d43c2c676e94081fbfee7eb6cbe933bDouglas Gregor /// 421fbb447e9d43c2c676e94081fbfee7eb6cbe933bDouglas Gregor /// \param IsDefinition Whether this is the definition of a macro, e.g., 431fbb447e9d43c2c676e94081fbfee7eb6cbe933bDouglas Gregor /// in a #define. 441fbb447e9d43c2c676e94081fbfee7eb6cbe933bDouglas Gregor virtual void CodeCompleteMacroName(bool IsDefinition) { } 45f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor}; 46f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor 47f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor} 48f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor 49f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9Douglas Gregor#endif // LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H 50