1 //===---- CodeCompleteOptions.h - Code Completion Options -------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_CLANG_SEMA_CODECOMPLETEOPTIONS_H 10 #define LLVM_CLANG_SEMA_CODECOMPLETEOPTIONS_H 11 12 #include "llvm/Support/Compiler.h" 13 14 namespace clang { 15 16 /// Options controlling the behavior of code completion. 17 class CodeCompleteOptions { 18 public: 19 /// Show macros in code completion results. 20 LLVM_PREFERRED_TYPE(bool) 21 unsigned IncludeMacros : 1; 22 23 /// Show code patterns in code completion results. 24 LLVM_PREFERRED_TYPE(bool) 25 unsigned IncludeCodePatterns : 1; 26 27 /// Show top-level decls in code completion results. 28 LLVM_PREFERRED_TYPE(bool) 29 unsigned IncludeGlobals : 1; 30 31 /// Show decls in namespace (including the global namespace) in code 32 /// completion results. If this is 0, `IncludeGlobals` will be ignored. 33 /// 34 /// Currently, this only works when completing qualified IDs (i.e. 35 /// `Sema::CodeCompleteQualifiedId`). 36 /// FIXME: consider supporting more completion cases with this option. 37 LLVM_PREFERRED_TYPE(bool) 38 unsigned IncludeNamespaceLevelDecls : 1; 39 40 /// Show brief documentation comments in code completion results. 41 LLVM_PREFERRED_TYPE(bool) 42 unsigned IncludeBriefComments : 1; 43 44 /// Hint whether to load data from the external AST to provide full results. 45 /// If false, namespace-level declarations and macros from the preamble may be 46 /// omitted. 47 LLVM_PREFERRED_TYPE(bool) 48 unsigned LoadExternal : 1; 49 50 /// Include results after corrections (small fix-its), e.g. change '.' to '->' 51 /// on member access, etc. 52 LLVM_PREFERRED_TYPE(bool) 53 unsigned IncludeFixIts : 1; 54 CodeCompleteOptions()55 CodeCompleteOptions() 56 : IncludeMacros(0), IncludeCodePatterns(0), IncludeGlobals(1), 57 IncludeNamespaceLevelDecls(1), IncludeBriefComments(0), 58 LoadExternal(1), IncludeFixIts(0) {} 59 }; 60 61 } // namespace clang 62 63 #endif 64 65