Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions include/swift/IDE/CodeCompletion.h
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ class CodeCompletionResult {
unsigned SemanticContext : 3;
unsigned NotRecommended : 1;
unsigned NotRecReason : 3;
unsigned IsSystem : 1;

/// The number of bytes to the left of the code completion point that
/// should be erased first if this completion string is inserted in the
Expand Down Expand Up @@ -634,6 +635,7 @@ class CodeCompletionResult {
assert(!isOperator() ||
getOperatorKind() != CodeCompletionOperatorKind::None);
AssociatedKind = 0;
IsSystem = 0;
}

/// Constructs a \c Keyword result.
Expand All @@ -651,6 +653,7 @@ class CodeCompletionResult {
TypeDistance(TypeDistance) {
assert(CompletionString);
AssociatedKind = static_cast<unsigned>(Kind);
IsSystem = 0;
}

/// Constructs a \c Literal result.
Expand All @@ -667,6 +670,7 @@ class CodeCompletionResult {
NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
TypeDistance(TypeDistance) {
AssociatedKind = static_cast<unsigned>(LiteralKind);
IsSystem = 0;
assert(CompletionString);
}

Expand Down Expand Up @@ -694,6 +698,7 @@ class CodeCompletionResult {
TypeDistance(TypeDistance) {
assert(AssociatedDecl && "should have a decl");
AssociatedKind = unsigned(getCodeCompletionDeclKind(AssociatedDecl));
IsSystem = getDeclIsSystem(AssociatedDecl);
assert(CompletionString);
if (isOperator())
KnownOperatorKind =
Expand All @@ -706,8 +711,8 @@ class CodeCompletionResult {
CodeCompletionResult(SemanticContextKind SemanticContext,
unsigned NumBytesToErase,
CodeCompletionString *CompletionString,
CodeCompletionDeclKind DeclKind, StringRef ModuleName,
bool NotRecommended,
CodeCompletionDeclKind DeclKind, bool IsSystem,
StringRef ModuleName, bool NotRecommended,
CodeCompletionResult::NotRecommendedReason NotRecReason,
StringRef BriefDocComment,
ArrayRef<StringRef> AssociatedUSRs,
Expand All @@ -718,10 +723,10 @@ class CodeCompletionResult {
KnownOperatorKind(unsigned(KnownOperatorKind)),
SemanticContext(unsigned(SemanticContext)),
NotRecommended(NotRecommended), NotRecReason(NotRecReason),
NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
ModuleName(ModuleName), BriefDocComment(BriefDocComment),
AssociatedUSRs(AssociatedUSRs), DocWords(DocWords),
TypeDistance(TypeDistance) {
IsSystem(IsSystem), NumBytesToErase(NumBytesToErase),
CompletionString(CompletionString), ModuleName(ModuleName),
BriefDocComment(BriefDocComment), AssociatedUSRs(AssociatedUSRs),
DocWords(DocWords), TypeDistance(TypeDistance) {
AssociatedKind = static_cast<unsigned>(DeclKind);
assert(CompletionString);
assert(!isOperator() ||
Expand Down Expand Up @@ -763,6 +768,10 @@ class CodeCompletionResult {
return static_cast<CodeCompletionOperatorKind>(KnownOperatorKind);
}

bool isSystem() const {
return static_cast<bool>(IsSystem);
}

ExpectedTypeRelation getExpectedTypeRelation() const {
return static_cast<ExpectedTypeRelation>(TypeDistance);
}
Expand Down Expand Up @@ -810,6 +819,7 @@ class CodeCompletionResult {
getCodeCompletionOperatorKind(StringRef name);
static CodeCompletionOperatorKind
getCodeCompletionOperatorKind(CodeCompletionString *str);
static bool getDeclIsSystem(const Decl *D);
};

struct CodeCompletionResultSink {
Expand Down
14 changes: 11 additions & 3 deletions lib/IDE/CodeCompletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,10 @@ CodeCompletionResult::getCodeCompletionDeclKind(const Decl *D) {
llvm_unreachable("invalid DeclKind");
}

bool CodeCompletionResult::getDeclIsSystem(const Decl *D) {
return D->getModuleContext()->isSystemModule();
}

void CodeCompletionResult::printPrefix(raw_ostream &OS) const {
llvm::SmallString<64> Prefix;
switch (getKind()) {
Expand Down Expand Up @@ -700,6 +704,8 @@ void CodeCompletionResult::printPrefix(raw_ostream &OS) const {
}
if (NotRecommended)
Prefix.append("/NotRecommended");
if (IsSystem)
Prefix.append("/IsSystem");
if (NumBytesToErase != 0) {
Prefix.append("/Erase[");
Prefix.append(Twine(NumBytesToErase).str());
Expand Down Expand Up @@ -4714,9 +4720,11 @@ class CompletionOverrideLookup : public swift::VisibleDeclConsumer {
else {
auto dist = Ctx.SourceMgr.getByteDistance(
introducerLoc, Ctx.SourceMgr.getCodeCompletionLoc());
Builder.setNumBytesToErase(dist);
Builder.addOverrideKeyword();
Builder.addDeclIntroducer(DeclStr.str().substr(0, NameOffset));
if (dist <= CodeCompletionResult::MaxNumBytesToErase) {
Builder.setNumBytesToErase(dist);
Builder.addOverrideKeyword();
Builder.addDeclIntroducer(DeclStr.str().substr(0, NameOffset));
}
Copy link
Member Author

@rintaro rintaro May 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akyrtzi There was no MaxNumBytesToErase check for override completion.

If the dist exceed MaxNumBytesToErase, completion just gives up adding override keyword before the introducer (e.g. func, var).

}
}

Expand Down
4 changes: 3 additions & 1 deletion lib/IDE/CodeCompletionCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
auto opKind = static_cast<CodeCompletionOperatorKind>(*cursor++);
auto context = static_cast<SemanticContextKind>(*cursor++);
auto notRecommended = static_cast<bool>(*cursor++);
auto isSystem = static_cast<bool>(*cursor++);
auto numBytesToErase = static_cast<unsigned>(*cursor++);
auto oldCursor = cursor;
auto chunkIndex = read32le(cursor);
Expand Down Expand Up @@ -248,7 +249,7 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
CodeCompletionResult *result = nullptr;
if (kind == CodeCompletionResult::Declaration) {
result = new (*V.Sink.Allocator) CodeCompletionResult(
context, numBytesToErase, string, declKind, moduleName,
context, numBytesToErase, string, declKind, isSystem, moduleName,
notRecommended, CodeCompletionResult::NotRecommendedReason::NoReason,
briefDocComment, copyStringArray(*V.Sink.Allocator, assocUSRs),
copyStringPairArray(*V.Sink.Allocator, declKeywords),
Expand Down Expand Up @@ -371,6 +372,7 @@ static void writeCachedModule(llvm::raw_ostream &out,
LE.write(static_cast<uint8_t>(CodeCompletionOperatorKind::None));
LE.write(static_cast<uint8_t>(R->getSemanticContext()));
LE.write(static_cast<uint8_t>(R->isNotRecommended()));
LE.write(static_cast<uint8_t>(R->isSystem()));
LE.write(static_cast<uint8_t>(R->getNumBytesToErase()));
LE.write(
static_cast<uint32_t>(addCompletionString(R->getCompletionString())));
Expand Down
12 changes: 6 additions & 6 deletions test/IDE/complete_annotation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ func testGlobal() {
// GLOBAL_EXPR-DAG: Literal[_Image]/None: <name>#imageLiteral</name>(<callarg><callarg.label>resourceName</callarg.label>: <callarg.type><typeid.sys>String</typeid.sys></callarg.type></callarg>); name=#imageLiteral(resourceName: String)
// GLOBAL_EXPR-DAG: Literal[Tuple]/None: (<callarg><callarg.param>values</callarg.param></callarg>); name=(values)
// GLOBAL_EXPR-DAG: Keyword[#function]/None: <name>#function</name>; name=#function
// GLOBAL_EXPR-DAG: Decl[Module]/None: <name>Swift</name>; name=Swift
// GLOBAL_EXPR-DAG: Decl[Struct]/OtherModule[Swift]: <name>Int</name>; name=Int
// GLOBAL_EXPR-DAG: Decl[FreeFunction]/OtherModule[Swift]: <name>print</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>items</callarg.param>: <callarg.type><keyword>Any</keyword></callarg.type>...</callarg>, <callarg><callarg.label>to</callarg.label> <callarg.param>output</callarg.param>: &amp;<callarg.type><typeid.sys>TextOutputStream</typeid.sys></callarg.type></callarg>); name=print(items: Any..., to: &TextOutputStream)
// GLOBAL_EXPR-DAG: Decl[Module]/None/IsSystem: <name>Swift</name>; name=Swift
// GLOBAL_EXPR-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: <name>Int</name>; name=Int
// GLOBAL_EXPR-DAG: Decl[FreeFunction]/OtherModule[Swift]/IsSystem: <name>print</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>items</callarg.param>: <callarg.type><keyword>Any</keyword></callarg.type>...</callarg>, <callarg><callarg.label>to</callarg.label> <callarg.param>output</callarg.param>: &amp;<callarg.type><typeid.sys>TextOutputStream</typeid.sys></callarg.type></callarg>); name=print(items: Any..., to: &TextOutputStream)
// GLOBAL_EXPR: End completions


Expand All @@ -58,8 +58,8 @@ func testType(value: #^GLOBAL_TYPE^#) {}
// GLOBAL_TYPE-DAG: Keyword/None: <keyword>Any</keyword>; name=Any
// GLOBAL_TYPE-DAG: Decl[Struct]/CurrModule: <name>MyStruct</name>; name=MyStruct
// GLOBAL_TYPE-DAG: Decl[Module]/None: <name>swift_ide_test</name>; name=swift_ide_test
// GLOBAL_TYPE-DAG: Decl[Module]/None: <name>Swift</name>; name=Swift
// GLOBAL_TYPE-DAG: Decl[Struct]/OtherModule[Swift]: <name>Int</name>; name=Int
// GLOBAL_TYPE-DAG: Decl[Module]/None/IsSystem: <name>Swift</name>; name=Swift
// GLOBAL_TYPE-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: <name>Int</name>; name=Int
// GLOBAL_TYPE: End completions


Expand Down Expand Up @@ -89,7 +89,7 @@ func testPostfix(value: MyStruct) {
// EXPR_POSTFIX-DAG: Decl[Subscript]/CurrNominal: [<callarg><callarg.label>_</callarg.label> <callarg.param>param</callarg.param>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>]; name=[param: Int]
// EXPR_POSTFIX-DAG: Decl[Subscript]/CurrNominal: [<callarg><callarg.label>label</callarg.label> <callarg.param>param</callarg.param>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>]; name=[label: Int]
// EXPR_POSTFIX-DAG: Keyword[self]/CurrNominal: <keyword>self</keyword>; name=self
// EXPR_POSTFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: <name>+</name>; name=+ MyStruct
// EXPR_POSTFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]/IsSystem: <name>+</name>; name=+ MyStruct
// EXPR_POSTFIX: End completions

func testImplicitMember() -> MyStruct {
Expand Down
10 changes: 5 additions & 5 deletions test/IDE/complete_at_start_1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// A-DAG: Literal[Boolean]/None: true[#Bool#]{{; name=.+$}}
// A-DAG: Literal[Boolean]/None: false[#Bool#]{{; name=.+$}}
// A-DAG: Literal[Nil]/None: nil{{; name=.+$}}
// A-DAG: Decl[Struct]/OtherModule[Swift]: Int8[#Int8#]{{; name=.+$}}
// A-DAG: Decl[Struct]/OtherModule[Swift]: Int16[#Int16#]{{; name=.+$}}
// A-DAG: Decl[Struct]/OtherModule[Swift]: Int32[#Int32#]{{; name=.+$}}
// A-DAG: Decl[Struct]/OtherModule[Swift]: Int64[#Int64#]{{; name=.+$}}
// A-DAG: Decl[Struct]/OtherModule[Swift]: Bool[#Bool#]{{; name=.+$}}
// A-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: Int8[#Int8#]{{; name=.+$}}
// A-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: Int16[#Int16#]{{; name=.+$}}
// A-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: Int32[#Int32#]{{; name=.+$}}
// A-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: Int64[#Int64#]{{; name=.+$}}
// A-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: Bool[#Bool#]{{; name=.+$}}
// A: End completions

// This function just adds more non-comment tokens to ensure that the file is not empty.
Expand Down
6 changes: 3 additions & 3 deletions test/IDE/complete_at_top_level.swift
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ func resyncParserB11() {}
// rdar://21346928
func optStr() -> String? { return nil }
let x = (optStr() ?? "autoclosure").#^TOP_LEVEL_AUTOCLOSURE_1^#
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal: unicodeScalars[#String.UnicodeScalarView#]
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal: utf16[#String.UTF16View#]
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal/IsSystem: unicodeScalars[#String.UnicodeScalarView#]
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal/IsSystem: utf16[#String.UTF16View#]

func resyncParserB12() {}

Expand Down Expand Up @@ -470,7 +470,7 @@ func resyncParserB14() {}
var stringInterp = "\(#^STRING_INTERP_3^#)"
_ = "" + "\(#^STRING_INTERP_4^#)" + ""
// STRING_INTERP: Begin completions
// STRING_INTERP-DAG: Decl[InstanceMethod]/CurrNominal: ['(']{#(value): T#}[')'][#Void#];
// STRING_INTERP-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: ['(']{#(value): T#}[')'][#Void#];
// STRING_INTERP-DAG: Decl[Struct]/CurrModule: FooStruct[#FooStruct#];
// STRING_INTERP-DAG: Decl[FreeFunction]/CurrModule/TypeRelation[Invalid]: fooFunc1()[#Void#];
// STRING_INTERP-DAG: Decl[FreeFunction]/CurrModule: optStr()[#String?#];
Expand Down
66 changes: 33 additions & 33 deletions test/IDE/complete_cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ import ctypes
@_private(sourceFile: "AppKit.swift") import AppKit

// CLANG_CTYPES: Begin completions
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/keyword[Foo1, Struct1]: FooStruct1[#FooStruct1#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/keyword[Foo2]: FooStruct2[#FooStruct2#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/recommended[Foo2, Foo1]: FooStruct3[#FooStruct3#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/recommendedover[Foo3, Foo2]: FooStruct4[#FooStruct4#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]: FooStruct5[#FooStruct5#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/recommendedover[ro1, ro2, ro3, ro4]/recommended[r1, r2, r3]/keyword[k1, k2, k3, k4]: FooStruct6[#FooStruct6#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[TypeAlias]/OtherModule[ctypes]/keyword[Foo2]: FooStructTypedef1[#FooStruct2#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem/keyword[Foo1, Struct1]: FooStruct1[#FooStruct1#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem/keyword[Foo2]: FooStruct2[#FooStruct2#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem/recommended[Foo2, Foo1]: FooStruct3[#FooStruct3#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem/recommendedover[Foo3, Foo2]: FooStruct4[#FooStruct4#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem: FooStruct5[#FooStruct5#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem/recommendedover[ro1, ro2, ro3, ro4]/recommended[r1, r2, r3]/keyword[k1, k2, k3, k4]: FooStruct6[#FooStruct6#]{{; name=.+$}}
// CLANG_CTYPES-DAG: Decl[TypeAlias]/OtherModule[ctypes]/IsSystem/keyword[Foo2]: FooStructTypedef1[#FooStruct2#]{{; name=.+$}}
// CLANG_CTYPES: End completions

// CLANG_MACROS: Begin completions
// CLANG_MACROS-DAG: Decl[GlobalVar]/OtherModule[macros]: USES_MACRO_FROM_OTHER_MODULE_1[#Int32#]{{; name=.+$}}
// CLANG_MACROS-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: USES_MACRO_FROM_OTHER_MODULE_1[#Int32#]{{; name=.+$}}
// CLANG_MACROS: End completions

// CLANG_DARWIN: Begin completions
// CLANG_DARWIN-DAG: Decl[TypeAlias]/OtherModule[Darwin.MacTypes]: FourCharCode[#UInt32#]{{; name=.+$}}
// CLANG_DARWIN-DAG: Decl[TypeAlias]/OtherModule[Darwin.MacTypes]/IsSystem: FourCharCode[#UInt32#]{{; name=.+$}}
// CLANG_DARWIN_NEG-NOT: FixedPtr
// CLANG_DARWIN_NEG-NOT: UniCharCoun
// CLANG_DARWIN: End completions
Expand All @@ -83,36 +83,36 @@ func testClangModule() {
func testCompleteModuleQualifiedMacros1() {
macros.#^CLANG_QUAL_MACROS_1^#
// CLANG_QUAL_MACROS_1: Begin completions
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: A_PI[#Double#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: CF_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: EOF[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: GL_FALSE[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: GL_RGBA[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: GL_RGB[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: MINUS_THREE[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: M_PIf[#Float#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-objc-DAG: Decl[GlobalVar]/OtherModule[macros]: OBJC_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: USES_MACRO_FROM_OTHER_MODULE_1[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: UTF8_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: VERSION_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: A_PI[#Double#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: CF_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: EOF[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: GL_FALSE[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: GL_RGBA[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: GL_RGB[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: MINUS_THREE[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: M_PIf[#Float#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-objc-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: OBJC_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: USES_MACRO_FROM_OTHER_MODULE_1[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: UTF8_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: VERSION_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_1: End completions
}

func testCompleteModuleQualifiedMacros2() {
macros#^CLANG_QUAL_MACROS_2^#
// CLANG_QUAL_MACROS_2: Begin completions
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .A_PI[#Double#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .CF_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .EOF[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .GL_FALSE[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .GL_RGBA[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .GL_RGB[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .MINUS_THREE[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .M_PIf[#Float#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-objc-DAG: Decl[GlobalVar]/OtherModule[macros]: .OBJC_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .USES_MACRO_FROM_OTHER_MODULE_1[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .UTF8_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .VERSION_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .A_PI[#Double#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .CF_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .EOF[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .GL_FALSE[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .GL_RGBA[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .GL_RGB[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .MINUS_THREE[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .M_PIf[#Float#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-objc-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .OBJC_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .USES_MACRO_FROM_OTHER_MODULE_1[#Int32#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .UTF8_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .VERSION_STRING[#String#]{{; name=.+$}}
// CLANG_QUAL_MACROS_2: End completions
}

Expand Down
Loading