Coverage Report

Created: 2018-07-20 23:04

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/include/clang/Lex/CodeCompletionHandler.h
Line
Count
Source (jump to first uncovered line)
1
//===--- CodeCompletionHandler.h - Preprocessor code completion -*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
//  This file defines the CodeCompletionHandler interface, which provides
11
//  code-completion callbacks for the preprocessor.
12
//
13
//===----------------------------------------------------------------------===//
14
#ifndef LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H
15
#define LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H
16
17
namespace clang {
18
19
class IdentifierInfo;
20
class MacroInfo;
21
  
22
/// Callback handler that receives notifications when performing code 
23
/// completion within the preprocessor.
24
class CodeCompletionHandler {
25
public:
26
  virtual ~CodeCompletionHandler();
27
  
28
  /// Callback invoked when performing code completion for a preprocessor
29
  /// directive.
30
  ///
31
  /// This callback will be invoked when the preprocessor processes a '#' at the
32
  /// start of a line, followed by the code-completion token.
33
  ///
34
  /// \param InConditional Whether we're inside a preprocessor conditional
35
  /// already.
36
0
  virtual void CodeCompleteDirective(bool InConditional) { }
37
  
38
  /// Callback invoked when performing code completion within a block of
39
  /// code that was excluded due to preprocessor conditionals.
40
0
  virtual void CodeCompleteInConditionalExclusion() { }
41
  
42
  /// Callback invoked when performing code completion in a context
43
  /// where the name of a macro is expected.
44
  ///
45
  /// \param IsDefinition Whether this is the definition of a macro, e.g.,
46
  /// in a \#define.
47
0
  virtual void CodeCompleteMacroName(bool IsDefinition) { }
48
  
49
  /// Callback invoked when performing code completion in a preprocessor
50
  /// expression, such as the condition of an \#if or \#elif directive.
51
0
  virtual void CodeCompletePreprocessorExpression() { }
52
  
53
  /// Callback invoked when performing code completion inside a 
54
  /// function-like macro argument.
55
  ///
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,
60
                                         MacroInfo *MacroInfo,
61
0
                                         unsigned ArgumentIndex) { }
62
63
  /// 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
0
  virtual void CodeCompleteNaturalLanguage() { }
67
};
68
  
69
}
70
71
#endif // LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H