mirror of
https://github.com/apple/pkl.git
synced 2026-04-23 16:58:37 +02:00
Fix tracking of known usages/subtypes (#1241)
Fixes an issue where known subtype/usage information is not gathered. Also: change class RuntimeData to not return pairs for better composability.
This commit is contained in:
@@ -84,8 +84,8 @@ internal data class RuntimeData(
|
|||||||
myRef: T,
|
myRef: T,
|
||||||
versions: Set<String>?,
|
versions: Set<String>?,
|
||||||
comparator: Comparator<String>,
|
comparator: Comparator<String>,
|
||||||
): Pair<RuntimeData, Boolean> {
|
): RuntimeData {
|
||||||
if (versions == null) return this to false
|
if (versions == null) return this
|
||||||
val newEffectiveVersions = knownVersions.mapTo(mutableSetOf()) { it.text } + versions
|
val newEffectiveVersions = knownVersions.mapTo(mutableSetOf()) { it.text } + versions
|
||||||
val knownVersions =
|
val knownVersions =
|
||||||
newEffectiveVersions
|
newEffectiveVersions
|
||||||
@@ -93,9 +93,9 @@ internal data class RuntimeData(
|
|||||||
.map { version -> RuntimeDataLink(text = version, href = myRef.pageUrlForVersion(version)) }
|
.map { version -> RuntimeDataLink(text = version, href = myRef.pageUrlForVersion(version)) }
|
||||||
.toSet()
|
.toSet()
|
||||||
if (knownVersions == this.knownVersions) {
|
if (knownVersions == this.knownVersions) {
|
||||||
return this to false
|
return this
|
||||||
}
|
}
|
||||||
return copy(knownVersions = knownVersions) to true
|
return copy(knownVersions = knownVersions)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T : ElementRef<*>> addKnownUsages(
|
fun <T : ElementRef<*>> addKnownUsages(
|
||||||
@@ -103,8 +103,8 @@ internal data class RuntimeData(
|
|||||||
refs: Collection<T>?,
|
refs: Collection<T>?,
|
||||||
text: (T) -> String,
|
text: (T) -> String,
|
||||||
comparator: Comparator<String>,
|
comparator: Comparator<String>,
|
||||||
): Pair<RuntimeData, Boolean> {
|
): RuntimeData {
|
||||||
if (refs == null) return this to false
|
if (refs == null) return this
|
||||||
val newLinks =
|
val newLinks =
|
||||||
refs.mapTo(mutableSetOf()) { ref ->
|
refs.mapTo(mutableSetOf()) { ref ->
|
||||||
RuntimeDataLink(text = text(ref), href = ref.pageUrlRelativeTo(myRef))
|
RuntimeDataLink(text = text(ref), href = ref.pageUrlRelativeTo(myRef))
|
||||||
@@ -112,27 +112,27 @@ internal data class RuntimeData(
|
|||||||
val knownUsages =
|
val knownUsages =
|
||||||
(this.knownUsages + newLinks).distinctByCommparator(comparator).sortedBy { it.text }.toSet()
|
(this.knownUsages + newLinks).distinctByCommparator(comparator).sortedBy { it.text }.toSet()
|
||||||
if (knownUsages == this.knownUsages) {
|
if (knownUsages == this.knownUsages) {
|
||||||
return this to false
|
return this
|
||||||
}
|
}
|
||||||
return copy(knownUsages = knownUsages) to true
|
return copy(knownUsages = knownUsages)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addKnownSubtypes(
|
fun addKnownSubtypes(
|
||||||
myRef: TypeRef,
|
myRef: TypeRef,
|
||||||
subtypes: Collection<TypeRef>?,
|
subtypes: Collection<TypeRef>?,
|
||||||
comparator: Comparator<String>,
|
comparator: Comparator<String>,
|
||||||
): Pair<RuntimeData, Boolean> {
|
): RuntimeData {
|
||||||
if (subtypes == null) return this to false
|
if (subtypes == null) return this
|
||||||
val newLinks =
|
val newLinks =
|
||||||
subtypes.mapTo(mutableSetOf()) { ref ->
|
subtypes.mapTo(mutableSetOf()) { ref ->
|
||||||
RuntimeDataLink(text = ref.displayName, href = ref.pageUrlRelativeTo(myRef))
|
RuntimeDataLink(text = ref.displayName, href = ref.pageUrlRelativeTo(myRef))
|
||||||
}
|
}
|
||||||
val knownSubtypes =
|
val knownSubtypes =
|
||||||
(this.knownUsages + newLinks).distinctByCommparator(comparator).sortedBy { it.text }.toSet()
|
(this.knownSubtypes + newLinks).distinctByCommparator(comparator).sortedBy { it.text }.toSet()
|
||||||
if (knownSubtypes == this.knownSubtypes) {
|
if (knownSubtypes == this.knownSubtypes) {
|
||||||
return this to false
|
return this
|
||||||
}
|
}
|
||||||
return copy(knownSubtypes = knownSubtypes) to true
|
return copy(knownSubtypes = knownSubtypes)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Collection<RuntimeDataLink>.distinctByCommparator(
|
fun Collection<RuntimeDataLink>.distinctByCommparator(
|
||||||
@@ -156,5 +156,5 @@ internal data class RuntimeData(
|
|||||||
|
|
||||||
fun perPackage(): RuntimeData = copy(knownUsages = setOf(), knownSubtypes = setOf())
|
fun perPackage(): RuntimeData = copy(knownUsages = setOf(), knownSubtypes = setOf())
|
||||||
|
|
||||||
fun perPackageVersion(): RuntimeData = RuntimeData(knownVersions = setOf())
|
fun perPackageVersion(): RuntimeData = copy(knownVersions = setOf())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,14 +126,10 @@ internal class RuntimeDataGenerator(
|
|||||||
// we must not have this package in our docsite.
|
// we must not have this package in our docsite.
|
||||||
if (!runtimeDataPath.isRegularFile()) return@launch
|
if (!runtimeDataPath.isRegularFile()) return@launch
|
||||||
val usages = packageUsages[ref]
|
val usages = packageUsages[ref]
|
||||||
val (data, hasNewData) =
|
val existingData = ref.existingPerPackageVersionRuntimeData
|
||||||
ref.existingPerPackageVersionRuntimeData.addKnownUsages(
|
val data =
|
||||||
ref,
|
existingData.addKnownUsages(ref, usages, PackageRef::pkg, descendingVersionComparator)
|
||||||
usages,
|
if (data != existingData) {
|
||||||
PackageRef::pkg,
|
|
||||||
descendingVersionComparator,
|
|
||||||
)
|
|
||||||
if (hasNewData) {
|
|
||||||
data.doWriteTo(outputDir.resolve(ref.perPackageVersionRuntimeDataPath))
|
data.doWriteTo(outputDir.resolve(ref.perPackageVersionRuntimeDataPath))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,7 +168,7 @@ internal class RuntimeDataGenerator(
|
|||||||
private fun writePackageFile(packageData: PackageData) {
|
private fun writePackageFile(packageData: PackageData) {
|
||||||
val ref = packageData.ref
|
val ref = packageData.ref
|
||||||
val newVersions = packageVersions[packageData.ref.pkg]?.mapTo(mutableSetOf()) { it.version }
|
val newVersions = packageVersions[packageData.ref.pkg]?.mapTo(mutableSetOf()) { it.version }
|
||||||
val (data, _) =
|
val data =
|
||||||
ref.existingPerPackageRuntimeData.addKnownVersions(
|
ref.existingPerPackageRuntimeData.addKnownVersions(
|
||||||
ref,
|
ref,
|
||||||
newVersions,
|
newVersions,
|
||||||
@@ -183,7 +179,7 @@ internal class RuntimeDataGenerator(
|
|||||||
|
|
||||||
private fun writePackageFilePerVersion(packageData: PackageData) {
|
private fun writePackageFilePerVersion(packageData: PackageData) {
|
||||||
val ref = packageData.ref
|
val ref = packageData.ref
|
||||||
val (data, _) =
|
val data =
|
||||||
ref.existingPerPackageVersionRuntimeData.addKnownUsages(
|
ref.existingPerPackageVersionRuntimeData.addKnownUsages(
|
||||||
ref,
|
ref,
|
||||||
packageUsages[ref],
|
packageUsages[ref],
|
||||||
@@ -196,7 +192,7 @@ internal class RuntimeDataGenerator(
|
|||||||
private fun writeClassFile(classData: ClassData) {
|
private fun writeClassFile(classData: ClassData) {
|
||||||
val ref = classData.ref
|
val ref = classData.ref
|
||||||
val newVersions = classVersions[ref.id]?.mapTo(mutableSetOf()) { it }
|
val newVersions = classVersions[ref.id]?.mapTo(mutableSetOf()) { it }
|
||||||
val (data, _) =
|
val data =
|
||||||
ref.existingPerPackageRuntimeData.addKnownVersions(
|
ref.existingPerPackageRuntimeData.addKnownVersions(
|
||||||
ref,
|
ref,
|
||||||
newVersions,
|
newVersions,
|
||||||
@@ -208,12 +204,11 @@ internal class RuntimeDataGenerator(
|
|||||||
private fun writeClassFilePerVersion(classData: ClassData) {
|
private fun writeClassFilePerVersion(classData: ClassData) {
|
||||||
val ref = classData.ref
|
val ref = classData.ref
|
||||||
val newSubtypes = subtypes[ref]
|
val newSubtypes = subtypes[ref]
|
||||||
val (data, _) =
|
val newUsages = typeUsages[ref]
|
||||||
ref.existingPerPackageVersionRuntimeData.addKnownSubtypes(
|
val data =
|
||||||
ref,
|
ref.existingPerPackageVersionRuntimeData
|
||||||
newSubtypes,
|
.addKnownSubtypes(ref, newSubtypes, descendingVersionComparator)
|
||||||
descendingVersionComparator,
|
.addKnownUsages(ref, newUsages, TypeRef::displayName, descendingVersionComparator)
|
||||||
)
|
|
||||||
data.writePerPackageVersion(ref)
|
data.writePerPackageVersion(ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "moduleExtend",
|
||||||
|
"href": "../moduleExtend/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,16 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "MyClass2",
|
||||||
|
"href": "MyClass2.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "MyClass3",
|
||||||
|
"href": "MyClass3.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "MyClass4",
|
||||||
|
"href": "MyClass4.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,12 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "MyClass3",
|
||||||
|
"href": "MyClass3.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "MyClass4",
|
||||||
|
"href": "MyClass4.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "TypeReferences",
|
||||||
|
"href": "TypeReferences.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "TypeReferences",
|
||||||
|
"href": "TypeReferences.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "Person1",
|
||||||
|
"href": "Person1.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "moduleMethodCommentInheritance",
|
||||||
|
"href": "../moduleMethodCommentInheritance/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "moduleMethodTypeReferences",
|
||||||
|
"href": "index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "UserDefinedAnnotation1",
|
||||||
|
"href": "UserDefinedAnnotation1.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "modulePropertyCommentInheritance",
|
||||||
|
"href": "../modulePropertyCommentInheritance/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "modulePropertyTypeReferences",
|
||||||
|
"href": "index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,12 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "Foo",
|
||||||
|
"href": "../moduleTypes2/Foo.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "moduleTypes2",
|
||||||
|
"href": "../moduleTypes2/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "Foo",
|
||||||
|
"href": "Foo.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,16 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "TypeReferences",
|
||||||
|
"href": "../classMethodTypeReferences/TypeReferences.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "moduleMethodTypeReferences",
|
||||||
|
"href": "../moduleMethodTypeReferences/index.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "modulePropertyTypeReferences",
|
||||||
|
"href": "../modulePropertyTypeReferences/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "Person2",
|
||||||
|
"href": "../typeAliasInheritance/Person2.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "typeAliasInheritance",
|
||||||
|
"href": "../typeAliasInheritance/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "com.package1",
|
||||||
|
"href": "../../com.package1/1.2.3/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "moduleExtend",
|
||||||
|
"href": "../moduleExtend/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,16 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "MyClass2",
|
||||||
|
"href": "MyClass2.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "MyClass3",
|
||||||
|
"href": "MyClass3.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "MyClass4",
|
||||||
|
"href": "MyClass4.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,12 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "MyClass3",
|
||||||
|
"href": "MyClass3.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "MyClass4",
|
||||||
|
"href": "MyClass4.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "TypeReferences",
|
||||||
|
"href": "TypeReferences.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "TypeReferences",
|
||||||
|
"href": "TypeReferences.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "Person1",
|
||||||
|
"href": "Person1.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "moduleMethodCommentInheritance",
|
||||||
|
"href": "../moduleMethodCommentInheritance/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "moduleMethodTypeReferences",
|
||||||
|
"href": "index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "UserDefinedAnnotation1",
|
||||||
|
"href": "UserDefinedAnnotation1.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "modulePropertyCommentInheritance",
|
||||||
|
"href": "../modulePropertyCommentInheritance/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "modulePropertyTypeReferences",
|
||||||
|
"href": "index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,12 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "Foo",
|
||||||
|
"href": "../moduleTypes2/Foo.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "moduleTypes2",
|
||||||
|
"href": "../moduleTypes2/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "Foo",
|
||||||
|
"href": "Foo.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,16 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "TypeReferences",
|
||||||
|
"href": "../classMethodTypeReferences/TypeReferences.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "moduleMethodTypeReferences",
|
||||||
|
"href": "../moduleMethodTypeReferences/index.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "modulePropertyTypeReferences",
|
||||||
|
"href": "../modulePropertyTypeReferences/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "Person2",
|
||||||
|
"href": "../typeAliasInheritance/Person2.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "typeAliasInheritance",
|
||||||
|
"href": "../typeAliasInheritance/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "com.package1",
|
||||||
|
"href": "../../com.package1/1.2.3/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "moduleExtend",
|
||||||
|
"href": "../moduleExtend/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,16 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "MyClass2",
|
||||||
|
"href": "MyClass2.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "MyClass3",
|
||||||
|
"href": "MyClass3.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "MyClass4",
|
||||||
|
"href": "MyClass4.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,12 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "MyClass3",
|
||||||
|
"href": "MyClass3.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "MyClass4",
|
||||||
|
"href": "MyClass4.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "TypeReferences",
|
||||||
|
"href": "TypeReferences.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "TypeReferences",
|
||||||
|
"href": "TypeReferences.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "Person1",
|
||||||
|
"href": "Person1.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "moduleMethodCommentInheritance",
|
||||||
|
"href": "../moduleMethodCommentInheritance/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "moduleMethodTypeReferences",
|
||||||
|
"href": "index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "UserDefinedAnnotation1",
|
||||||
|
"href": "UserDefinedAnnotation1.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "modulePropertyCommentInheritance",
|
||||||
|
"href": "../modulePropertyCommentInheritance/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "modulePropertyTypeReferences",
|
||||||
|
"href": "index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,12 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "Foo",
|
||||||
|
"href": "../moduleTypes2/Foo.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "moduleTypes2",
|
||||||
|
"href": "../moduleTypes2/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "Foo",
|
||||||
|
"href": "Foo.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,20 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "TypeReferences",
|
||||||
|
"href": "../classMethodTypeReferences/TypeReferences.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "TypeReferences",
|
||||||
|
"href": "../classPropertyTypeReferences/TypeReferences.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "moduleMethodTypeReferences",
|
||||||
|
"href": "../moduleMethodTypeReferences/index.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "modulePropertyTypeReferences",
|
||||||
|
"href": "../modulePropertyTypeReferences/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "Person2",
|
||||||
|
"href": "../typeAliasInheritance/Person2.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownSubtypes": [
|
||||||
|
{
|
||||||
|
"text": "typeAliasInheritance",
|
||||||
|
"href": "../typeAliasInheritance/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "ternalPackage",
|
||||||
|
"href": "../../../com.package1/1.2.3/ternalPackage/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"knownUsages": [
|
||||||
|
{
|
||||||
|
"text": "com.package1",
|
||||||
|
"href": "../../com.package1/1.2.3/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -147,6 +147,8 @@ class CliDocGeneratorTest {
|
|||||||
assertThat(e).hasMessageContaining("at least one", "module")
|
assertThat(e).hasMessageContaining("at least one", "module")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// to re-generate output, delete directory pkl-doc/src/test/files/DocGeneratorTest/output and run
|
||||||
|
// again
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
@MethodSource("generateDocs")
|
@MethodSource("generateDocs")
|
||||||
fun test(relativeFilePath: String) {
|
fun test(relativeFilePath: String) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class RuntimeDataTest {
|
|||||||
ModuleRef(pkg = "foo", pkgUri = null, version = "1.3.0", module = "foo"),
|
ModuleRef(pkg = "foo", pkgUri = null, version = "1.3.0", module = "foo"),
|
||||||
)
|
)
|
||||||
val result = current.addKnownUsages(ref, usages, { it.fullName }, descendingVersionComparator)
|
val result = current.addKnownUsages(ref, usages, { it.fullName }, descendingVersionComparator)
|
||||||
assertThat(result.first)
|
assertThat(result)
|
||||||
.isEqualTo(
|
.isEqualTo(
|
||||||
RuntimeData(
|
RuntimeData(
|
||||||
knownUsages = setOf(RuntimeDataLink("foo.foo", "../../../foo/1.3.0/foo/index.html"))
|
knownUsages = setOf(RuntimeDataLink("foo.foo", "../../../foo/1.3.0/foo/index.html"))
|
||||||
@@ -59,7 +59,7 @@ class RuntimeDataTest {
|
|||||||
val usages = setOf(ModuleRef(pkg = "foo", pkgUri = null, version = "1.2.0", module = "foo"))
|
val usages = setOf(ModuleRef(pkg = "foo", pkgUri = null, version = "1.2.0", module = "foo"))
|
||||||
|
|
||||||
val result = current.addKnownUsages(ref, usages, { it.fullName }, descendingVersionComparator)
|
val result = current.addKnownUsages(ref, usages, { it.fullName }, descendingVersionComparator)
|
||||||
assertThat(result.first)
|
assertThat(result)
|
||||||
.isEqualTo(
|
.isEqualTo(
|
||||||
RuntimeData(
|
RuntimeData(
|
||||||
knownUsages = setOf(RuntimeDataLink("foo.foo", "../../../foo/1.3.0/foo/index.html"))
|
knownUsages = setOf(RuntimeDataLink("foo.foo", "../../../foo/1.3.0/foo/index.html"))
|
||||||
|
|||||||
Reference in New Issue
Block a user