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/Ownership.h
"
27
#include "
clang/Sema/SemaBase.h
"
28
#include "llvm/ADT/StringRef.h"
29
#include <optional>
30
31
namespace
clang
{
32
class
DeclGroupRef;
33
class
MacroInfo;
34
class
Scope;
35
class
TemplateName;
36
37
class
SemaCodeCompletion
:
public
SemaBase
{
38
public
:
39
SemaCodeCompletion
(
Sema
&S,
CodeCompleteConsumer
*CompletionConsumer);
40
41
using
TemplateTy
=
OpaquePtr<TemplateName>
;
42
using
DeclGroupPtrTy
=
OpaquePtr<DeclGroupRef>
;
43
44
/// Code-completion consumer.
45
CodeCompleteConsumer
*
CodeCompleter
;
46
47
/// Describes the context in which code completion occurs.
48
enum
ParserCompletionContext
{
49
/// Code completion occurs at top-level or namespace context.
50
PCC_Namespace
,
51
/// Code completion occurs within a class, struct, or union.
52
PCC_Class
,
53
/// Code completion occurs within an Objective-C interface, protocol,
54
/// or category.
55
PCC_ObjCInterface
,
56
/// Code completion occurs within an Objective-C implementation or
57
/// category implementation
58
PCC_ObjCImplementation
,
59
/// Code completion occurs within the list of instance variables
60
/// in an Objective-C interface, protocol, category, or implementation.
61
PCC_ObjCInstanceVariableList
,
62
/// Code completion occurs following one or more template
63
/// headers.
64
PCC_Template
,
65
/// Code completion occurs following one or more template
66
/// headers within a class.
67
PCC_MemberTemplate
,
68
/// Code completion occurs within an expression.
69
PCC_Expression
,
70
/// Code completion occurs within a statement, which may
71
/// also be an expression or a declaration.