Skip to content

Commit bfde3b0

Browse files
authored
Merge pull request #31646 from rintaro/ide-completion-issystem-rdar62617558
[CodeCompletion] Add 'IsSystem' flag to code completion result item
2 parents 3b73065 + f80fdfc commit bfde3b0

File tree

49 files changed

+427
-365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+427
-365
lines changed

include/swift/IDE/CodeCompletion.h

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ class CodeCompletionResult {
594594
unsigned SemanticContext : 3;
595595
unsigned NotRecommended : 1;
596596
unsigned NotRecReason : 3;
597+
unsigned IsSystem : 1;
597598

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

639641
/// Constructs a \c Keyword result.
@@ -651,6 +653,7 @@ class CodeCompletionResult {
651653
TypeDistance(TypeDistance) {
652654
assert(CompletionString);
653655
AssociatedKind = static_cast<unsigned>(Kind);
656+
IsSystem = 0;
654657
}
655658

656659
/// Constructs a \c Literal result.
@@ -667,6 +670,7 @@ class CodeCompletionResult {
667670
NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
668671
TypeDistance(TypeDistance) {
669672
AssociatedKind = static_cast<unsigned>(LiteralKind);
673+
IsSystem = 0;
670674
assert(CompletionString);
671675
}
672676

@@ -694,6 +698,7 @@ class CodeCompletionResult {
694698
TypeDistance(TypeDistance) {
695699
assert(AssociatedDecl && "should have a decl");
696700
AssociatedKind = unsigned(getCodeCompletionDeclKind(AssociatedDecl));
701+
IsSystem = getDeclIsSystem(AssociatedDecl);
697702
assert(CompletionString);
698703
if (isOperator())
699704
KnownOperatorKind =
@@ -706,8 +711,8 @@ class CodeCompletionResult {
706711
CodeCompletionResult(SemanticContextKind SemanticContext,
707712
unsigned NumBytesToErase,
708713
CodeCompletionString *CompletionString,
709-
CodeCompletionDeclKind DeclKind, StringRef ModuleName,
710-
bool NotRecommended,
714+
CodeCompletionDeclKind DeclKind, bool IsSystem,
715+
StringRef ModuleName, bool NotRecommended,
711716
CodeCompletionResult::NotRecommendedReason NotRecReason,
712717
StringRef BriefDocComment,
713718
ArrayRef<StringRef> AssociatedUSRs,
@@ -718,10 +723,10 @@ class CodeCompletionResult {
718723
KnownOperatorKind(unsigned(KnownOperatorKind)),
719724
SemanticContext(unsigned(SemanticContext)),
720725
NotRecommended(NotRecommended), NotRecReason(NotRecReason),
721-
NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
722-
ModuleName(ModuleName), BriefDocComment(BriefDocComment),
723-
AssociatedUSRs(AssociatedUSRs), DocWords(DocWords),
724-
TypeDistance(TypeDistance) {
726+
IsSystem(IsSystem), NumBytesToErase(NumBytesToErase),
727+
CompletionString(CompletionString), ModuleName(ModuleName),
728+
BriefDocComment(BriefDocComment), AssociatedUSRs(AssociatedUSRs),
729+
DocWords(DocWords), TypeDistance(TypeDistance) {
725730
AssociatedKind = static_cast<unsigned>(DeclKind);
726731
assert(CompletionString);
727732
assert(!isOperator() ||
@@ -763,6 +768,10 @@ class CodeCompletionResult {
763768
return static_cast<CodeCompletionOperatorKind>(KnownOperatorKind);
764769
}
765770

771+
bool isSystem() const {
772+
return static_cast<bool>(IsSystem);
773+
}
774+
766775
ExpectedTypeRelation getExpectedTypeRelation() const {
767776
return static_cast<ExpectedTypeRelation>(TypeDistance);
768777
}
@@ -810,6 +819,7 @@ class CodeCompletionResult {
810819
getCodeCompletionOperatorKind(StringRef name);
811820
static CodeCompletionOperatorKind
812821
getCodeCompletionOperatorKind(CodeCompletionString *str);
822+
static bool getDeclIsSystem(const Decl *D);
813823
};
814824

815825
struct CodeCompletionResultSink {

lib/IDE/CodeCompletion.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,10 @@ CodeCompletionResult::getCodeCompletionDeclKind(const Decl *D) {
539539
llvm_unreachable("invalid DeclKind");
540540
}
541541

542+
bool CodeCompletionResult::getDeclIsSystem(const Decl *D) {
543+
return D->getModuleContext()->isSystemModule();
544+
}
545+
542546
void CodeCompletionResult::printPrefix(raw_ostream &OS) const {
543547
llvm::SmallString<64> Prefix;
544548
switch (getKind()) {
@@ -700,6 +704,8 @@ void CodeCompletionResult::printPrefix(raw_ostream &OS) const {
700704
}
701705
if (NotRecommended)
702706
Prefix.append("/NotRecommended");
707+
if (IsSystem)
708+
Prefix.append("/IsSystem");
703709
if (NumBytesToErase != 0) {
704710
Prefix.append("/Erase[");
705711
Prefix.append(Twine(NumBytesToErase).str());
@@ -4714,9 +4720,11 @@ class CompletionOverrideLookup : public swift::VisibleDeclConsumer {
47144720
else {
47154721
auto dist = Ctx.SourceMgr.getByteDistance(
47164722
introducerLoc, Ctx.SourceMgr.getCodeCompletionLoc());
4717-
Builder.setNumBytesToErase(dist);
4718-
Builder.addOverrideKeyword();
4719-
Builder.addDeclIntroducer(DeclStr.str().substr(0, NameOffset));
4723+
if (dist <= CodeCompletionResult::MaxNumBytesToErase) {
4724+
Builder.setNumBytesToErase(dist);
4725+
Builder.addOverrideKeyword();
4726+
Builder.addDeclIntroducer(DeclStr.str().substr(0, NameOffset));
4727+
}
47204728
}
47214729
}
47224730

lib/IDE/CodeCompletionCache.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
215215
auto opKind = static_cast<CodeCompletionOperatorKind>(*cursor++);
216216
auto context = static_cast<SemanticContextKind>(*cursor++);
217217
auto notRecommended = static_cast<bool>(*cursor++);
218+
auto isSystem = static_cast<bool>(*cursor++);
218219
auto numBytesToErase = static_cast<unsigned>(*cursor++);
219220
auto oldCursor = cursor;
220221
auto chunkIndex = read32le(cursor);
@@ -248,7 +249,7 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
248249
CodeCompletionResult *result = nullptr;
249250
if (kind == CodeCompletionResult::Declaration) {
250251
result = new (*V.Sink.Allocator) CodeCompletionResult(
251-
context, numBytesToErase, string, declKind, moduleName,
252+
context, numBytesToErase, string, declKind, isSystem, moduleName,
252253
notRecommended, CodeCompletionResult::NotRecommendedReason::NoReason,
253254
briefDocComment, copyStringArray(*V.Sink.Allocator, assocUSRs),
254255
copyStringPairArray(*V.Sink.Allocator, declKeywords),
@@ -371,6 +372,7 @@ static void writeCachedModule(llvm::raw_ostream &out,
371372
LE.write(static_cast<uint8_t>(CodeCompletionOperatorKind::None));
372373
LE.write(static_cast<uint8_t>(R->getSemanticContext()));
373374
LE.write(static_cast<uint8_t>(R->isNotRecommended()));
375+
LE.write(static_cast<uint8_t>(R->isSystem()));
374376
LE.write(static_cast<uint8_t>(R->getNumBytesToErase()));
375377
LE.write(
376378
static_cast<uint32_t>(addCompletionString(R->getCompletionString())));

test/IDE/complete_annotation.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ func testGlobal() {
4747
// 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)
4848
// GLOBAL_EXPR-DAG: Literal[Tuple]/None: (<callarg><callarg.param>values</callarg.param></callarg>); name=(values)
4949
// GLOBAL_EXPR-DAG: Keyword[#function]/None: <name>#function</name>; name=#function
50-
// GLOBAL_EXPR-DAG: Decl[Module]/None: <name>Swift</name>; name=Swift
51-
// GLOBAL_EXPR-DAG: Decl[Struct]/OtherModule[Swift]: <name>Int</name>; name=Int
52-
// 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)
50+
// GLOBAL_EXPR-DAG: Decl[Module]/None/IsSystem: <name>Swift</name>; name=Swift
51+
// GLOBAL_EXPR-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: <name>Int</name>; name=Int
52+
// 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)
5353
// GLOBAL_EXPR: End completions
5454

5555

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

6565

@@ -89,7 +89,7 @@ func testPostfix(value: MyStruct) {
8989
// 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]
9090
// 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]
9191
// EXPR_POSTFIX-DAG: Keyword[self]/CurrNominal: <keyword>self</keyword>; name=self
92-
// EXPR_POSTFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: <name>+</name>; name=+ MyStruct
92+
// EXPR_POSTFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]/IsSystem: <name>+</name>; name=+ MyStruct
9393
// EXPR_POSTFIX: End completions
9494

9595
func testImplicitMember() -> MyStruct {

test/IDE/complete_at_start_1.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// A-DAG: Literal[Boolean]/None: true[#Bool#]{{; name=.+$}}
99
// A-DAG: Literal[Boolean]/None: false[#Bool#]{{; name=.+$}}
1010
// A-DAG: Literal[Nil]/None: nil{{; name=.+$}}
11-
// A-DAG: Decl[Struct]/OtherModule[Swift]: Int8[#Int8#]{{; name=.+$}}
12-
// A-DAG: Decl[Struct]/OtherModule[Swift]: Int16[#Int16#]{{; name=.+$}}
13-
// A-DAG: Decl[Struct]/OtherModule[Swift]: Int32[#Int32#]{{; name=.+$}}
14-
// A-DAG: Decl[Struct]/OtherModule[Swift]: Int64[#Int64#]{{; name=.+$}}
15-
// A-DAG: Decl[Struct]/OtherModule[Swift]: Bool[#Bool#]{{; name=.+$}}
11+
// A-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: Int8[#Int8#]{{; name=.+$}}
12+
// A-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: Int16[#Int16#]{{; name=.+$}}
13+
// A-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: Int32[#Int32#]{{; name=.+$}}
14+
// A-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: Int64[#Int64#]{{; name=.+$}}
15+
// A-DAG: Decl[Struct]/OtherModule[Swift]/IsSystem: Bool[#Bool#]{{; name=.+$}}
1616
// A: End completions
1717

1818
// This function just adds more non-comment tokens to ensure that the file is not empty.

test/IDE/complete_at_top_level.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ func resyncParserB11() {}
435435
// rdar://21346928
436436
func optStr() -> String? { return nil }
437437
let x = (optStr() ?? "autoclosure").#^TOP_LEVEL_AUTOCLOSURE_1^#
438-
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal: unicodeScalars[#String.UnicodeScalarView#]
439-
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal: utf16[#String.UTF16View#]
438+
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal/IsSystem: unicodeScalars[#String.UnicodeScalarView#]
439+
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal/IsSystem: utf16[#String.UTF16View#]
440440

441441
func resyncParserB12() {}
442442

@@ -470,7 +470,7 @@ func resyncParserB14() {}
470470
var stringInterp = "\(#^STRING_INTERP_3^#)"
471471
_ = "" + "\(#^STRING_INTERP_4^#)" + ""
472472
// STRING_INTERP: Begin completions
473-
// STRING_INTERP-DAG: Decl[InstanceMethod]/CurrNominal: ['(']{#(value): T#}[')'][#Void#];
473+
// STRING_INTERP-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: ['(']{#(value): T#}[')'][#Void#];
474474
// STRING_INTERP-DAG: Decl[Struct]/CurrModule: FooStruct[#FooStruct#];
475475
// STRING_INTERP-DAG: Decl[FreeFunction]/CurrModule/TypeRelation[Invalid]: fooFunc1()[#Void#];
476476
// STRING_INTERP-DAG: Decl[FreeFunction]/CurrModule: optStr()[#String?#];

test/IDE/complete_cache.swift

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@ import ctypes
5757
@_private(sourceFile: "AppKit.swift") import AppKit
5858

5959
// CLANG_CTYPES: Begin completions
60-
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/keyword[Foo1, Struct1]: FooStruct1[#FooStruct1#]{{; name=.+$}}
61-
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/keyword[Foo2]: FooStruct2[#FooStruct2#]{{; name=.+$}}
62-
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/recommended[Foo2, Foo1]: FooStruct3[#FooStruct3#]{{; name=.+$}}
63-
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/recommendedover[Foo3, Foo2]: FooStruct4[#FooStruct4#]{{; name=.+$}}
64-
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]: FooStruct5[#FooStruct5#]{{; name=.+$}}
65-
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/recommendedover[ro1, ro2, ro3, ro4]/recommended[r1, r2, r3]/keyword[k1, k2, k3, k4]: FooStruct6[#FooStruct6#]{{; name=.+$}}
66-
// CLANG_CTYPES-DAG: Decl[TypeAlias]/OtherModule[ctypes]/keyword[Foo2]: FooStructTypedef1[#FooStruct2#]{{; name=.+$}}
60+
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem/keyword[Foo1, Struct1]: FooStruct1[#FooStruct1#]{{; name=.+$}}
61+
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem/keyword[Foo2]: FooStruct2[#FooStruct2#]{{; name=.+$}}
62+
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem/recommended[Foo2, Foo1]: FooStruct3[#FooStruct3#]{{; name=.+$}}
63+
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem/recommendedover[Foo3, Foo2]: FooStruct4[#FooStruct4#]{{; name=.+$}}
64+
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/IsSystem: FooStruct5[#FooStruct5#]{{; name=.+$}}
65+
// 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=.+$}}
66+
// CLANG_CTYPES-DAG: Decl[TypeAlias]/OtherModule[ctypes]/IsSystem/keyword[Foo2]: FooStructTypedef1[#FooStruct2#]{{; name=.+$}}
6767
// CLANG_CTYPES: End completions
6868

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

7373
// CLANG_DARWIN: Begin completions
74-
// CLANG_DARWIN-DAG: Decl[TypeAlias]/OtherModule[Darwin.MacTypes]: FourCharCode[#UInt32#]{{; name=.+$}}
74+
// CLANG_DARWIN-DAG: Decl[TypeAlias]/OtherModule[Darwin.MacTypes]/IsSystem: FourCharCode[#UInt32#]{{; name=.+$}}
7575
// CLANG_DARWIN_NEG-NOT: FixedPtr
7676
// CLANG_DARWIN_NEG-NOT: UniCharCoun
7777
// CLANG_DARWIN: End completions
@@ -83,36 +83,36 @@ func testClangModule() {
8383
func testCompleteModuleQualifiedMacros1() {
8484
macros.#^CLANG_QUAL_MACROS_1^#
8585
// CLANG_QUAL_MACROS_1: Begin completions
86-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: A_PI[#Double#]{{; name=.+$}}
87-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: CF_STRING[#String#]{{; name=.+$}}
88-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: EOF[#Int32#]{{; name=.+$}}
89-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: GL_FALSE[#Int32#]{{; name=.+$}}
90-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: GL_RGBA[#Int32#]{{; name=.+$}}
91-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: GL_RGB[#Int32#]{{; name=.+$}}
92-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: MINUS_THREE[#Int32#]{{; name=.+$}}
93-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: M_PIf[#Float#]{{; name=.+$}}
94-
// CLANG_QUAL_MACROS_1-objc-DAG: Decl[GlobalVar]/OtherModule[macros]: OBJC_STRING[#String#]{{; name=.+$}}
95-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: USES_MACRO_FROM_OTHER_MODULE_1[#Int32#]{{; name=.+$}}
96-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: UTF8_STRING[#String#]{{; name=.+$}}
97-
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]: VERSION_STRING[#String#]{{; name=.+$}}
86+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: A_PI[#Double#]{{; name=.+$}}
87+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: CF_STRING[#String#]{{; name=.+$}}
88+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: EOF[#Int32#]{{; name=.+$}}
89+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: GL_FALSE[#Int32#]{{; name=.+$}}
90+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: GL_RGBA[#Int32#]{{; name=.+$}}
91+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: GL_RGB[#Int32#]{{; name=.+$}}
92+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: MINUS_THREE[#Int32#]{{; name=.+$}}
93+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: M_PIf[#Float#]{{; name=.+$}}
94+
// CLANG_QUAL_MACROS_1-objc-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: OBJC_STRING[#String#]{{; name=.+$}}
95+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: USES_MACRO_FROM_OTHER_MODULE_1[#Int32#]{{; name=.+$}}
96+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: UTF8_STRING[#String#]{{; name=.+$}}
97+
// CLANG_QUAL_MACROS_1-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: VERSION_STRING[#String#]{{; name=.+$}}
9898
// CLANG_QUAL_MACROS_1: End completions
9999
}
100100

101101
func testCompleteModuleQualifiedMacros2() {
102102
macros#^CLANG_QUAL_MACROS_2^#
103103
// CLANG_QUAL_MACROS_2: Begin completions
104-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .A_PI[#Double#]{{; name=.+$}}
105-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .CF_STRING[#String#]{{; name=.+$}}
106-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .EOF[#Int32#]{{; name=.+$}}
107-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .GL_FALSE[#Int32#]{{; name=.+$}}
108-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .GL_RGBA[#Int32#]{{; name=.+$}}
109-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .GL_RGB[#Int32#]{{; name=.+$}}
110-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .MINUS_THREE[#Int32#]{{; name=.+$}}
111-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .M_PIf[#Float#]{{; name=.+$}}
112-
// CLANG_QUAL_MACROS_2-objc-DAG: Decl[GlobalVar]/OtherModule[macros]: .OBJC_STRING[#String#]{{; name=.+$}}
113-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .USES_MACRO_FROM_OTHER_MODULE_1[#Int32#]{{; name=.+$}}
114-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .UTF8_STRING[#String#]{{; name=.+$}}
115-
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .VERSION_STRING[#String#]{{; name=.+$}}
104+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .A_PI[#Double#]{{; name=.+$}}
105+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .CF_STRING[#String#]{{; name=.+$}}
106+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .EOF[#Int32#]{{; name=.+$}}
107+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .GL_FALSE[#Int32#]{{; name=.+$}}
108+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .GL_RGBA[#Int32#]{{; name=.+$}}
109+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .GL_RGB[#Int32#]{{; name=.+$}}
110+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .MINUS_THREE[#Int32#]{{; name=.+$}}
111+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .M_PIf[#Float#]{{; name=.+$}}
112+
// CLANG_QUAL_MACROS_2-objc-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .OBJC_STRING[#String#]{{; name=.+$}}
113+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .USES_MACRO_FROM_OTHER_MODULE_1[#Int32#]{{; name=.+$}}
114+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .UTF8_STRING[#String#]{{; name=.+$}}
115+
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]/IsSystem: .VERSION_STRING[#String#]{{; name=.+$}}
116116
// CLANG_QUAL_MACROS_2: End completions
117117
}
118118

0 commit comments

Comments
 (0)