Skip to content

Commit a9727db

Browse files
committed
ModuleGroup: Add several subgroups.
1 parent 03871e2 commit a9727db

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

stdlib/public/core/GroupInfo.json

+13-9
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"CollectionAlgorithms.swift",
3232
"EmptyCollection.swift",
3333
"Stride.swift",
34-
"HashedCollections.swift",
3534
"Repeat.swift",
3635
"Sort.swift",
3736
"Range.swift",
@@ -69,7 +68,9 @@
6968
"CocoaArray.swift",
7069
"ContiguousArrayBuffer.swift",
7170
"SliceBuffer.swift",
72-
"SwiftNativeNSArray.swift"]
71+
"SwiftNativeNSArray.swift"],
72+
"HashedCollections": [
73+
"HashedCollections.swift"]
7374
}
7475
],
7576
"C": [
@@ -86,14 +87,17 @@
8687
"ObjCMirrors.swift"
8788
],
8889
"Math": [
89-
"FloatingPoint.swift",
90-
"FloatingPointOperations.swift",
91-
"FloatingPointParsing.swift",
92-
"IntegerArithmetic.swift",
93-
"FixedPoint.swift",
94-
"IntegerParsing.swift",
9590
"SetAlgebra.swift",
96-
"BuiltinMath.swift"
91+
"BuiltinMath.swift",
92+
{
93+
"Integers": [
94+
"IntegerArithmetic.swift",
95+
"FixedPoint.swift",
96+
"IntegerParsing.swift"],
97+
"Floating": [
98+
"FloatingPoint.swift",
99+
"FloatingPointOperations.swift",
100+
"FloatingPointParsing.swift"]}
97101
],
98102
"Optional": [
99103
"ImplicitlyUnwrappedOptional.swift",

test/SourceKit/InterfaceGen/gen_stdlib.swift

+2-8
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,14 @@ var x: Int
3434
// CHECK1-NEXT: s:Si
3535
// CHECK1-NEXT: Int.Type
3636
// CHECK1-NEXT: Swift{{$}}
37-
// CHECK1-NEXT: <Group>Math</Group>
37+
// CHECK1-NEXT: <Group>Math/Integers</Group>
3838
// CHECK1-NEXT: /<interface-gen>{{$}}
3939
// CHECK1-NEXT: SYSTEM
4040
// CHECK1-NEXT: <Declaration>struct Int : <Type usr="s:Ps13SignedInteger">SignedInteger</Type>{{.*}}{{.*}}<Type usr="s:Ps10Comparable">Comparable</Type>{{.*}}<Type usr="s:Ps9Equatable">Equatable</Type>{{.*}}</Declaration>
4141

4242
// RUN: %sourcekitd-test -req=module-groups -module Swift | FileCheck -check-prefix=GROUP1 %s
4343
// GROUP1: <GROUPS>
44-
// GROUP1-DAG: Assert
45-
// GROUP1-DAG: String
46-
// GROUP1-DAG: Collection
47-
// GROUP1-DAG: Collection/Lazy Views
48-
// GROUP1-DAG: Bool
49-
// GROUP1-DAG: Math
50-
// GROUP1-DAG: Misc
44+
// GROUP1-NOT: <NULL>
5145
// GROUP1: <\GROUPS>
5246

5347
// RUN: %sourcekitd-test -req=interface-gen -module Swift -group-name Bool > %t.Bool.response

test/SourceKit/SourceDocInfo/cursor_info.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class C7 {
185185
// CHECK2-NEXT: s:ZFsoi1pFTSiSi_Si
186186
// CHECK2-NEXT: (Int, Int) -> Int{{$}}
187187
// CHECK2-NEXT: Swift{{$}}
188-
// CHECK2-NEXT: <Group>Math</Group>
188+
// CHECK2-NEXT: <Group>Math/Integers</Group>
189189
// CHECK2-NEXT: SYSTEM
190190
// CHECK2-NEXT: <Declaration>func +(lhs: <Type usr="s:Si">Int</Type>, rhs: <Type usr="s:Si">Int</Type>) -&gt; <Type usr="s:Si">Int</Type></Declaration>
191191
// CHECK2-NEXT: <decl.function.operator.infix><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>+</decl.name>(<decl.var.parameter><decl.var.parameter.name>lhs</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr="s:Si">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.name>rhs</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr="s:Si">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>) -&gt; <decl.function.returntype><ref.struct usr="s:Si">Int</ref.struct></decl.function.returntype></decl.function.operator.infix>

tools/swift-ide-test/swift-ide-test.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,8 @@ struct GroupNamesPrinter {
16401640
void addDecl(const Decl *D) {
16411641
if(auto VD = dyn_cast<ValueDecl>(D)) {
16421642
if (!VD->isImplicit() && !VD->isPrivateStdlibDecl()) {
1643-
StringRef Name = VD->getGroupName().getValue();
1643+
StringRef Name = VD->getGroupName().hasValue() ?
1644+
VD->getGroupName().getValue() : "";
16441645
Groups.insert(Name.empty() ? "<NULL>" : Name);
16451646
}
16461647
}

0 commit comments

Comments
 (0)