feat: don't truncate pkldoc module names that lack the package prefix (#1909)
Co-authored-by: Jen Basch <jbasch@apple.com>
This commit is contained in:
1 parent
f96fba00e1
commit
6811abf11c
20 files changed
+68
-37
No files matched your search
@@ -344,7 +344,7 @@ internal class DocModule(
|
||||
get() = schema.moduleName
|
||||
|
||||
val path: String by lazy {
|
||||
name.pathEncoded.substring(parent.docPackageInfo.moduleNamePrefix.length).replace('.', '/')
|
||||
name.removePrefix(parent.docPackageInfo.moduleNamePrefix).pathEncoded.replace('.', '/')
|
||||
}
|
||||
|
||||
val overview: String?
|
||||
|
||||
@@ -461,7 +461,7 @@ private fun findTypesUsedBy(
|
||||
enclosingPackage.uri,
|
||||
enclosingPackage.version,
|
||||
enclosingType.moduleName
|
||||
.substring(enclosingPackage.moduleNamePrefix.length)
|
||||
.removePrefix(enclosingPackage.moduleNamePrefix)
|
||||
.replace('.', '/'),
|
||||
PClassInfo.MODULE_CLASS_NAME,
|
||||
)
|
||||
|
||||
@@ -115,7 +115,7 @@ internal val String.uriEncoded
|
||||
get(): String = replace(Regex("([^;/?:@&=+$,#]+)")) { it.value.uriEncodedComponent }
|
||||
|
||||
fun getModulePath(moduleName: String, packagePrefix: String): String =
|
||||
moduleName.substring(packagePrefix.length).replace('.', '/')
|
||||
moduleName.removePrefix(packagePrefix).replace('.', '/')
|
||||
|
||||
/**
|
||||
* Turns `"foo.bar.baz-biz"` into ``"foo.bar.`baz-biz`"``.
|
||||
|
||||
Reference in new issue
Block a user