clang
20.0.0git
include
clang
Sema
SemaCodeCompletion.h
Go to the documentation of this file.
1
//===----- SemaCodeCompletion.h ------ Code completion support ------------===//
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
/// \file
9
/// This file declares facilities that support code completion.
10
///
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_CLANG_SEMA_SEMACODECOMPLETION_H
14
#define LLVM_CLANG_SEMA_SEMACODECOMPLETION_H
15
16
#include "
clang/AST/ASTFwd.h
"
17
#include "
clang/AST/Type.h
"
18
#include "
clang/Basic/AttributeCommonInfo.h
"
19
#include "
clang/Basic/IdentifierTable.h
"
20
#include "
clang/Basic/LLVM.h
"
21
#include "
clang/Basic/SourceLocation.h
"
22
#include "
clang/Lex/ModuleLoader.h
"
23
#include "
clang/Sema/CodeCompleteConsumer.h
"
24
#include "
clang/Sema/DeclSpec.h
"
25
#include "
clang/Sema/Designator.h
"
26
#include "
clang/Sema/HeuristicResolver.h
"
27
#include "
clang/Sema/Ownership.h
"
28
#include "
clang/Sema/SemaBase.h
"
29
#include "llvm/ADT/StringRef.h"
30
#include <optional>
31
32
namespace
clang
{
33
class
DeclGroupRef;
34
class
MacroInfo;
35
class
Scope;
36
class
TemplateName;
37
38
class
SemaCodeCompletion
:
public
SemaBase
{
39
public
:
40
SemaCodeCompletion
(
Sema
&S,
CodeCompleteConsumer
*CompletionConsumer);
41
42
using
TemplateTy
=
OpaquePtr<TemplateName>
;
43
using
DeclGroupPtrTy
=
OpaquePtr<DeclGroupRef>
;
44
45
/// Code-completion consumer.
46
CodeCompleteConsumer
*
CodeCompleter
;
47
HeuristicResolver
Resolver
;
48
49
/// Describes the context in which code completion occurs.
50
enum
ParserCompletionContext
{
51
/// Code completion occurs at top-level or namespace context.
52
PCC_Namespace
,
53
/// Code completion occurs within a class, struct, or union.
54
PCC_Class
,
55
/// Code completion occurs within an Objective-C interface, protocol,
56
/// or category.
57
PCC_ObjCInterface
,
58
/// Code completion occurs within an Objective-C implementation or
59
/// category implementation
60
PCC_ObjCImplementation
,
61
/// Code completion occurs within the list of instance variables
62
/// in an Objective-C interface, protocol, category, or implementation.
63
PCC_ObjCInstanceVariableList
,
64
/// Code completion occurs following one or more template
65
/// headers.
66
PCC_Template
,
67
/// Code completion occurs following one or more template
68
/// headers within a class.
69
PCC_MemberTemplate
,
70
/// Code completion occurs within an expression.