Skip to content

Commit aeea756

Browse files
author
Nathan Hawes
authored
Merge pull request swiftlang#27935 from nathawes/module-qualified-type-completion
[code-completion] Suggest module names, and handle module name bases for member completion in type position
2 parents 74328cd + eabb561 commit aeea756

File tree

7 files changed

+175
-49
lines changed

7 files changed

+175
-49
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 81 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,8 +1317,21 @@ class CodeCompletionCallbacksImpl : public CodeCompletionCallbacks {
13171317
/// \returns true on success, false on failure.
13181318
bool typecheckParsedType() {
13191319
assert(ParsedTypeLoc.getTypeRepr() && "should have a TypeRepr");
1320-
return !performTypeLocChecking(P.Context, ParsedTypeLoc,
1321-
CurDeclContext, false);
1320+
if (!performTypeLocChecking(P.Context, ParsedTypeLoc,
1321+
CurDeclContext, false))
1322+
return true;
1323+
1324+
// It doesn't type check as a type, so see if it's a qualifying module name.
1325+
if (auto *ITR = dyn_cast<IdentTypeRepr>(ParsedTypeLoc.getTypeRepr())) {
1326+
SmallVector<ImportDecl::AccessPathElement, 4> AccessPath;
1327+
for (auto Component : ITR->getComponentRange())
1328+
AccessPath.push_back({ Component->getIdentifier(),
1329+
Component->getIdLoc() });
1330+
if (auto Module = Context.getLoadedModule(AccessPath))
1331+
ParsedTypeLoc.setType(ModuleType::get(Module));
1332+
return true;
1333+
}
1334+
return false;
13221335
}
13231336

13241337
public:
@@ -1583,26 +1596,37 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
15831596
bool OnlyTypes;
15841597
bool OnlyPrecedenceGroups;
15851598
bool NeedLeadingDot;
1599+
bool IncludeModuleQualifier;
15861600

15871601
static RequestedResultsTy fromModule(const ModuleDecl *TheModule) {
1588-
return { TheModule, false, false, false };
1602+
return { TheModule, false, false, false, true };
15891603
}
15901604

15911605
RequestedResultsTy onlyTypes() const {
1592-
return { TheModule, true, false, NeedLeadingDot };
1606+
return { TheModule, true, false, NeedLeadingDot, IncludeModuleQualifier };
15931607
}
15941608

15951609
RequestedResultsTy onlyPrecedenceGroups() const {
15961610
assert(!OnlyTypes && "onlyTypes() already includes precedence groups");
1597-
return { TheModule, false, true, false };
1611+
return { TheModule, false, true, false, true };
15981612
}
15991613

16001614
RequestedResultsTy needLeadingDot(bool NeedDot) const {
1601-
return { TheModule, OnlyTypes, OnlyPrecedenceGroups, NeedDot };
1615+
return {
1616+
TheModule, OnlyTypes, OnlyPrecedenceGroups, NeedDot,
1617+
IncludeModuleQualifier
1618+
};
1619+
}
1620+
1621+
RequestedResultsTy withModuleQualifier(bool IncludeModule) const {
1622+
return {
1623+
TheModule, OnlyTypes, OnlyPrecedenceGroups, NeedLeadingDot,
1624+
IncludeModule
1625+
};
16021626
}
16031627

16041628
static RequestedResultsTy toplevelResults() {
1605-
return { nullptr, false, false, false };
1629+
return { nullptr, false, false, false, true };
16061630
}
16071631
};
16081632

@@ -1704,7 +1728,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
17041728
CodeCompletionResultBuilder Builder(Sink,
17051729
CodeCompletionResult::ResultKind::
17061730
Declaration,
1707-
SemanticContextKind::OtherModule,
1731+
SemanticContextKind::None,
17081732
expectedTypeContext);
17091733
auto MD = ModuleDecl::create(Ctx.getIdentifier(Pair.first), Ctx);
17101734
Builder.setAssociatedDecl(MD);
@@ -1741,6 +1765,21 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
17411765
}
17421766
}
17431767

1768+
void addModuleName(
1769+
const ModuleDecl *MD,
1770+
Optional<CodeCompletionResult::NotRecommendedReason> R = None) {
1771+
CodeCompletionResultBuilder Builder(
1772+
Sink,
1773+
CodeCompletionResult::ResultKind::Declaration,
1774+
SemanticContextKind::None,
1775+
expectedTypeContext);
1776+
Builder.setAssociatedDecl(MD);
1777+
Builder.addTextChunk(MD->getNameStr());
1778+
Builder.addTypeAnnotation("Module");
1779+
if (R)
1780+
Builder.setNotRecommended(*R);
1781+
}
1782+
17441783
void addImportModuleNames() {
17451784
SmallVector<Identifier, 0> ModuleNames;
17461785
Ctx.getVisibleTopLevelModuleNames(ModuleNames);
@@ -1757,19 +1796,13 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
17571796
continue;
17581797

17591798
auto MD = ModuleDecl::create(ModuleName, Ctx);
1760-
CodeCompletionResultBuilder Builder(
1761-
Sink,
1762-
CodeCompletionResult::ResultKind::Declaration,
1763-
SemanticContextKind::OtherModule,
1764-
expectedTypeContext);
1765-
Builder.setAssociatedDecl(MD);
1766-
Builder.addTextChunk(MD->getNameStr());
1767-
Builder.addTypeAnnotation("Module");
1799+
Optional<CodeCompletionResult::NotRecommendedReason> Reason = None;
17681800

17691801
// Imported modules are not recommended.
17701802
if (ImportedModules.count(MD->getNameStr()) != 0)
1771-
Builder.setNotRecommended(
1772-
CodeCompletionResult::NotRecommendedReason::Redundant);
1803+
Reason = CodeCompletionResult::NotRecommendedReason::Redundant;
1804+
1805+
addModuleName(MD, Reason);
17731806
}
17741807
}
17751808

@@ -3203,13 +3236,17 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
32033236
return false;
32043237
}
32053238

3206-
bool tryModuleCompletions(Type ExprType) {
3239+
bool tryModuleCompletions(Type ExprType, bool TypesOnly = false) {
32073240
if (auto MT = ExprType->getAs<ModuleType>()) {
32083241
ModuleDecl *M = MT->getModule();
32093242
if (CurrModule != M) {
32103243
// Only use the cache if it is not the current module.
3211-
RequestedCachedResults.push_back(
3212-
RequestedResultsTy::fromModule(M).needLeadingDot(needDot()));
3244+
RequestedResultsTy Request = RequestedResultsTy::fromModule(M)
3245+
.needLeadingDot(needDot())
3246+
.withModuleQualifier(false);
3247+
if (TypesOnly)
3248+
Request = Request.onlyTypes();
3249+
RequestedCachedResults.push_back(Request);
32133250
return true;
32143251
}
32153252
}
@@ -3767,17 +3804,16 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
37673804

37683805
void getValueCompletionsInDeclContext(SourceLoc Loc,
37693806
DeclFilter Filter = DefaultFilter,
3770-
bool IncludeTopLevel = false,
3771-
bool RequestCache = true,
3772-
bool LiteralCompletions = true) {
3807+
bool LiteralCompletions = true,
3808+
bool ModuleQualifier = true) {
37733809
ExprType = Type();
37743810
Kind = LookupKind::ValueInDeclContext;
37753811
NeedLeadingDot = false;
37763812
FilteredDeclConsumer Consumer(*this, Filter);
37773813
lookupVisibleDecls(Consumer, CurrDeclContext,
3778-
/*IncludeTopLevel=*/IncludeTopLevel, Loc);
3779-
if (RequestCache)
3780-
RequestedCachedResults.push_back(RequestedResultsTy::toplevelResults());
3814+
/*IncludeTopLevel=*/false, Loc);
3815+
RequestedCachedResults.push_back(RequestedResultsTy::toplevelResults()
3816+
.withModuleQualifier(ModuleQualifier));
37813817

37823818
// Manually add any expected nominal types from imported modules so that
37833819
// they get their expected type relation. Don't include protocols, since
@@ -3875,6 +3911,8 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
38753911
}
38763912

38773913
void getTypeCompletions(Type BaseType) {
3914+
if (tryModuleCompletions(BaseType, /*OnlyTypes=*/true))
3915+
return;
38783916
Kind = LookupKind::Type;
38793917
this->BaseType = BaseType;
38803918
NeedLeadingDot = !HaveDot;
@@ -3884,7 +3922,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
38843922
if (BaseType->isAnyExistentialType()) {
38853923
addKeyword("Protocol", MetatypeType::get(BaseType));
38863924
addKeyword("Type", ExistentialMetatypeType::get(BaseType));
3887-
} else {
3925+
} else if (!BaseType->is<ModuleType>()) {
38883926
addKeyword("Type", MetatypeType::get(BaseType));
38893927
}
38903928
}
@@ -3962,8 +4000,9 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
39624000
if (Module == CurrModule)
39634001
continue;
39644002

3965-
RequestedCachedResults.push_back(
3966-
RequestedResultsTy::fromModule(Module).onlyPrecedenceGroups());
4003+
RequestedCachedResults.push_back(RequestedResultsTy::fromModule(Module)
4004+
.onlyPrecedenceGroups()
4005+
.withModuleQualifier(false));
39674006
}
39684007
}
39694008

@@ -4000,13 +4039,16 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
40004039
getAttributeDeclParamCompletions(DAK_Available, 0);
40014040
}
40024041

4003-
void getTypeCompletionsInDeclContext(SourceLoc Loc) {
4042+
void getTypeCompletionsInDeclContext(SourceLoc Loc,
4043+
bool ModuleQualifier = true) {
40044044
Kind = LookupKind::TypeInDeclContext;
40054045
lookupVisibleDecls(*this, CurrDeclContext,
40064046
/*IncludeTopLevel=*/false, Loc);
40074047

40084048
RequestedCachedResults.push_back(
4009-
RequestedResultsTy::toplevelResults().onlyTypes());
4049+
RequestedResultsTy::toplevelResults()
4050+
.onlyTypes()
4051+
.withModuleQualifier(ModuleQualifier));
40104052
}
40114053

40124054
void getToplevelCompletions(bool OnlyTypes) {
@@ -5273,7 +5315,7 @@ void CodeCompletionCallbacksImpl::doneParsing() {
52735315
} else {
52745316
SourceLoc Loc = P.Context.SourceMgr.getCodeCompletionLoc();
52755317
Lookup.getValueCompletionsInDeclContext(Loc, KeyPathFilter,
5276-
false, true, false);
5318+
/*LiteralCompletions=*/false);
52775319
}
52785320
break;
52795321
}
@@ -5508,6 +5550,8 @@ void CodeCompletionCallbacksImpl::doneParsing() {
55085550
return; // already handled.
55095551
RequestedModules.push_back({std::move(K), TheModule,
55105552
Request.OnlyTypes, Request.OnlyPrecedenceGroups});
5553+
if (Request.IncludeModuleQualifier)
5554+
Lookup.addModuleName(TheModule);
55115555
}
55125556
};
55135557

@@ -5520,6 +5564,10 @@ void CodeCompletionCallbacksImpl::doneParsing() {
55205564
// Add results from current module.
55215565
Lookup.getToplevelCompletions(Request.OnlyTypes);
55225566

5567+
// Add the qualifying module name
5568+
if (Request.IncludeModuleQualifier)
5569+
Lookup.addModuleName(CurDeclContext->getParentModule());
5570+
55235571
// Add results for all imported modules.
55245572
ModuleDecl::ImportFilter ImportFilter;
55255573
ImportFilter |= ModuleDecl::ImportFilterKind::Public;

test/IDE/complete_from_clang_framework.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
// RUN: %target-swift-ide-test -code-completion -source-filename %s -F %S/Inputs/mock-sdk -enable-objc-interop -code-completion-token=CLANG_CLASS_MEMBERS_2 | %FileCheck %s -check-prefix=CLANG_CLASS_MEMBERS_2
2929
// RUN: %target-swift-ide-test -code-completion -source-filename %s -F %S/Inputs/mock-sdk -enable-objc-interop -code-completion-token=CLANG_INSTANCE_MEMBERS_1 | %FileCheck %s -check-prefix=CLANG_INSTANCE_MEMBERS_1
3030

31+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -F %S/Inputs/mock-sdk -enable-objc-interop -code-completion-token=TYPE_MODULE_QUALIFIER | %FileCheck %s -check-prefix=MODULE_QUALIFIER
32+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -F %S/Inputs/mock-sdk -enable-objc-interop -code-completion-token=EXPR_MODULE_QUALIFIER | %FileCheck %s -check-prefix=MODULE_QUALIFIER
33+
3134
import Foo
3235
// Don't import FooHelper directly in this test!
3336
// import FooHelper
@@ -332,3 +335,15 @@ func testCompleteInstanceMembers1(fooObject: FooClassDerived) {
332335
// CLANG_INSTANCE_MEMBERS_1-NEXT: Decl[InstanceMethod]/Super: ._internalMeth1()[#Any!#]
333336
// CLANG_INSTANCE_MEMBERS_1-NOT: Instance
334337
}
338+
339+
// Check the FooHelper module is suggested even though it's not imported directly
340+
func testExportedModuleCompletion() -> #^TYPE_MODULE_QUALIFIER^# {
341+
let x = #^EXPR_MODULE_QUALIFIER^#
342+
// MODULE_QUALIFIER: Begin completions
343+
// MODULE_QUALIFIER-DAG: Decl[Module]/None: swift_ide_test[#Module#]; name=swift_ide_test
344+
// MODULE_QUALIFIER-DAG: Decl[Module]/None: Swift[#Module#]; name=Swift
345+
// MODULE_QUALIFIER-DAG: Decl[Module]/None: Foo[#Module#]; name=Foo
346+
// MODULE_QUALIFIER-DAG: Decl[Module]/None: FooHelper[#Module#]; name=FooHelper
347+
// MODULE_QUALIFIER-DAG: Decl[Module]/None: Bar[#Module#]; name=Bar
348+
// MODULE_QUALIFIER: End completions
349+
}

test/IDE/complete_from_swift_module.swift

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
//
55
// Note: this test checks both module import case and file import case.
66

7+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=QUALIFYING_MODULE > %t.compl.txt
8+
// RUN: %FileCheck %s -check-prefix=QUALIFYING_MODULE < %t.compl.txt
9+
10+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=QUALIFYING_MODULE_2 > %t.compl.txt
11+
// RUN: %FileCheck %s -check-prefix=QUALIFYING_MODULE < %t.compl.txt
12+
13+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=ALREADY_QUALIFIED > %t.compl.txt
14+
// RUN: %FileCheck %s -check-prefix=ALREADY_QUALIFIED < %t.compl.txt
15+
716
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=MODULE_QUALIFIED_1 > %t.compl.txt
817
// RUN: %FileCheck %s -check-prefix=MODULE_QUALIFIED_1 < %t.compl.txt
918
//
@@ -21,6 +30,15 @@
2130

2231
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=MODULE_QUALIFIED_5 | %FileCheck %s -check-prefix=ERROR_COMMON
2332

33+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=STDLIB_TYPE_QUALIFIED_NESTED > %t.compl.txt
34+
// RUN: %FileCheck %s -check-prefix=STDLIB_TYPE_QUALIFIED_NESTED < %t.compl.txt
35+
36+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=STDLIB_TYPE_QUALIFIED > %t.compl.txt
37+
// RUN: %FileCheck %s -check-prefix=STDLIB_TYPE_QUALIFIED < %t.compl.txt
38+
39+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=MODULE_TYPE_QUALIFIED > %t.compl.txt
40+
// RUN: %FileCheck %s -check-prefix=MODULE_TYPE_QUALIFIED < %t.compl.txt
41+
2442
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=POSTFIX_OPERATOR_1 > %t.compl.txt
2543
// RUN: %FileCheck %s -check-prefix=POSTFIX_OPERATOR_1 < %t.compl.txt
2644
// RUN: %FileCheck %s -check-prefix=NEGATIVE_POSTFIX_OPERATOR_1 < %t.compl.txt
@@ -41,6 +59,27 @@
4159
import foo_swift_module
4260
import corrupted_module
4361

62+
func testQualifyingModulesSuggested() -> #^QUALIFYING_MODULE^# {
63+
let x = #^QUALIFYING_MODULE_2^#
64+
// QUALIFYING_MODULE: Begin completions
65+
// QUALIFYING_MODULE-DAG: Decl[Module]/None: swift_ide_test[#Module#]; name=swift_ide_test
66+
// QUALIFYING_MODULE-DAG: Decl[Module]/None: Swift[#Module#]; name=Swift
67+
// QUALIFYING_MODULE-DAG: Decl[Module]/None: foo_swift_module[#Module#]; name=foo_swift_module
68+
// QUALIFYING_MODULE: End completions
69+
}
70+
71+
struct SomeStructInThisModule {}
72+
func testQualifyingModulesNotSuggested() {
73+
let x: swift_ide_test.#^ALREADY_QUALIFIED^#;
74+
// ALREADY_QUALIFIED: Begin completions
75+
// ALREADY_QUALIFIED-NOT: Decl[Module]
76+
// ALREADY_QUALIFIED-NOT: name=Type
77+
// ALREADY_QUALIFIED: name=SomeStructInThisModule
78+
// ALREADY_QUALIFIED-NOT: Decl[Module]
79+
// ALREADY_QUALIFIED-NOT: name=Type
80+
// ALREADY_QUALIFIED: End completions
81+
}
82+
4483
var hiddenImport : Int
4584
// TOP_LEVEL_1_NEGATIVE-NOT: hiddenImport()
4685

@@ -99,3 +138,26 @@ func testPostfixOperator1(x: Int) {
99138
// TOP_LEVEL_1-DAG: Decl[GlobalVar]/Local: hiddenImport[#Int#]{{; name=.+$}}
100139
// TOP_LEVEL_1-DAG: Decl[GlobalVar]/OtherModule[foo_swift_module]: globalVar[#Int#]{{; name=.+$}}
101140
// TOP_LEVEL_1: End completions
141+
142+
struct Foo: Swift.Array.#^STDLIB_TYPE_QUALIFIED_NESTED^# {}
143+
// STDLIB_TYPE_QUALIFIED_NESTED: Begin completions
144+
// STDLIB_TYPE_QUALIFIED_NESTED: Decl[TypeAlias]/CurrNominal: Index[#Int#]; name=Index
145+
// STDLIB_TYPE_QUALIFIED_NESTED: Decl[TypeAlias]/CurrNominal: Element[#Element#]; name=Element
146+
// STDLIB_TYPE_QUALIFIED_NESTED: Keyword/None: Type[#Array.Type#]; name=Type
147+
// STDLIB_TYPE_QUALIFIED_NESTED: End completions
148+
149+
struct Bar: Swift.#^STDLIB_TYPE_QUALIFIED^# {}
150+
// STDLIB_TYPE_QUALIFIED: Begin completions
151+
// STDLIB_TYPE_QUALIFIED-NOT: Decl[Module]
152+
// STDLIB_TYPE_QUALIFIED: Decl[Struct]/OtherModule[Swift]: AnyCollection[#AnyCollection#]; name=AnyCollection
153+
// STDLIB_TYPE_QUALIFIED-NOT: Decl[Module]
154+
// STDLIB_TYPE_QUALIFIED: End completions
155+
156+
func foo() -> foo_swift_module.#^MODULE_TYPE_QUALIFIED^# {}
157+
// MODULE_TYPE_QUALIFIED: Begin completions
158+
// MODULE_TYPE_QUALIFIED: Decl[Protocol]/OtherModule[foo_swift_module]: BarProtocol[#BarProtocol#]; name=BarProtocol
159+
// MODULE_TYPE_QUALIFIED: Decl[Enum]/OtherModule[foo_swift_module]: MyQuickLookObject[#MyQuickLookObject#]; name=MyQuickLookObject
160+
// MODULE_TYPE_QUALIFIED: Decl[Struct]/OtherModule[foo_swift_module]: BarGenericSwiftStruct1[#BarGenericSwiftStruct1#]; name=BarGenericSwiftStruct1
161+
// MODULE_TYPE_QUALIFIED: Decl[Struct]/OtherModule[foo_swift_module]: FooSwiftStruct[#FooSwiftStruct#]; name=FooSwiftStruct
162+
// MODULE_TYPE_QUALIFIED: Decl[Struct]/OtherModule[foo_swift_module]: BarGenericSwiftStruct2[#BarGenericSwiftStruct2#]; name=BarGenericSwiftStruct2
163+
// MODULE_TYPE_QUALIFIED: End completions

test/IDE/complete_import.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@
1212
import #^CLANG_IMPORT1^#
1313

1414
// CLANG_IMPORT1: Begin completions
15-
// CLANG_IMPORT1-DAG: Decl[Module]/OtherModule[Foo]: Foo[#Module#]; name=Foo
16-
// CLANG_IMPORT1-DAG: Decl[Module]/OtherModule[FooHelper]: FooHelper[#Module#]; name=FooHelper
17-
// CLANG_IMPORT1-DAG: Decl[Module]/OtherModule[Bar]: Bar[#Module#]; name=Bar
15+
// CLANG_IMPORT1-DAG: Decl[Module]/None: Foo[#Module#]; name=Foo
16+
// CLANG_IMPORT1-DAG: Decl[Module]/None: FooHelper[#Module#]; name=FooHelper
17+
// CLANG_IMPORT1-DAG: Decl[Module]/None: Bar[#Module#]; name=Bar
1818
// CLANG_IMPORT1-NOT: SwiftShims
1919

2020
import Foo
2121

2222
import #^CLANG_IMPORT2^#
2323

2424
// CLANG_IMPORT2: Begin completions
25-
// CLANG_IMPORT2-DAG: Decl[Module]/OtherModule[Foo]/NotRecommended: Foo[#Module#]; name=Foo
26-
// CLANG_IMPORT2-DAG: Decl[Module]/OtherModule[FooHelper]/NotRecommended: FooHelper[#Module#]; name=FooHelper
27-
// CLANG_IMPORT2-DAG: Decl[Module]/OtherModule[Bar]: Bar[#Module#]; name=Bar
28-
// CLANG_IMPORT2-NOT: SwiftShims
25+
// CLANG_IMPORT2-DAG: Decl[Module]/None/NotRecommended: Foo[#Module#]; name=Foo
26+
// CLANG_IMPORT2-DAG: Decl[Module]/None/NotRecommended: FooHelper[#Module#]; name=FooHelper
27+
// CLANG_IMPORT2-DAG: Decl[Module]/None: Bar[#Module#]; name=Bar
28+
// CLANG_IMPORT2-NOT: SwiftShims
2929

3030
import Foo.#^CLANG_IMPORT3^#
3131

3232
// CLANG_IMPORT3: Begin completions
33-
// CLANG_IMPORT3-NEXT: Decl[Module]/OtherModule[FooSub]: FooSub[#Module#]; name=FooSub
33+
// CLANG_IMPORT3-NEXT: Decl[Module]/None: FooSub[#Module#]; name=FooSub
3434

3535
import Foo.FooSub
3636

3737
import Foo.#^CLANG_IMPORT8^#
3838

3939
// FIXME: This should be marked as not recommended, holding for Swift's submodules support.
4040
// CLANG_IMPORT8: Begin completions
41-
// CLANG_IMPORT8-NEXT: Decl[Module]/OtherModule[FooSub]: FooSub[#Module#]; name=FooSub
41+
// CLANG_IMPORT8-NEXT: Decl[Module]/None: FooSub[#Module#]; name=FooSub
4242

4343
import Foo#^CLANG_IMPORT4^#
4444
// CLANG_IMPORT4-NOT: Begin completions

0 commit comments

Comments
 (0)