aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt14
-rw-r--r--core/src/main/kotlin/Kotlin/DocumentationBuilder.kt4
-rw-r--r--core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt4
-rw-r--r--core/src/main/kotlin/main.kt2
4 files changed, 12 insertions, 12 deletions
diff --git a/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt b/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt
index 5911660c..80e02c0c 100644
--- a/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt
+++ b/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt
@@ -6,8 +6,8 @@ import com.intellij.psi.PsiNamedElement
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.dokka.*
import org.jetbrains.kotlin.descriptors.*
-import org.jetbrains.kotlin.idea.kdoc.KDocFinder
-import org.jetbrains.kotlin.idea.kdoc.getResolutionScope
+import org.jetbrains.kotlin.idea.kdoc.findKDoc
+import org.jetbrains.kotlin.idea.kdoc.getKDocLinkResolutionScope
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.kdoc.psi.impl.KDocSection
import org.jetbrains.kotlin.kdoc.psi.impl.KDocTag
@@ -41,7 +41,7 @@ class DescriptorDocumentationParser
return parseJavadoc(descriptor)
}
- val kdoc = KDocFinder.findKDoc(descriptor) ?: findStdlibKDoc(descriptor)
+ val kdoc = descriptor.findKDoc() ?: findStdlibKDoc(descriptor)
if (kdoc == null) {
if (options.reportUndocumented && !descriptor.isDeprecated() &&
descriptor !is ValueParameterDescriptor && descriptor !is TypeParameterDescriptor &&
@@ -106,7 +106,7 @@ class DescriptorDocumentationParser
val anyMethod = it.getMemberScope(listOf())
.getDescriptorsFiltered(DescriptorKindFilter.FUNCTIONS, { it == descriptor.name })
.single()
- val kdoc = KDocFinder.findKDoc(anyMethod)
+ val kdoc = anyMethod.findKDoc()
if (kdoc != null) {
return kdoc
}
@@ -149,7 +149,7 @@ class DescriptorDocumentationParser
logger.warn("Missing function name in @sample in ${descriptor.signature()}")
return ContentBlockCode().let() { it.append(ContentText("Missing function name in @sample")); it }
}
- val scope = getResolutionScope(resolutionFacade, descriptor)
+ val scope = getKDocLinkResolutionScope(resolutionFacade, descriptor)
val rootPackage = resolutionFacade.moduleDescriptor.getPackage(FqName.ROOT)
val rootScope = rootPackage.memberScope
val symbol = resolveInScope(functionName, scope) ?: resolveInScope(functionName, rootScope)
@@ -188,7 +188,7 @@ class DescriptorDocumentationParser
for (part in parts) {
// short name
- val symbolName = Name.guess(part)
+ val symbolName = Name.identifier(part)
val partSymbol = currentScope.getContributedDescriptors(DescriptorKindFilter.ALL, { it == symbolName })
.filter { it.name == symbolName }
.firstOrNull()
@@ -202,7 +202,7 @@ class DescriptorDocumentationParser
else if (partSymbol is PackageViewDescriptor)
partSymbol.memberScope
else
- getResolutionScope(resolutionFacade, partSymbol)
+ getKDocLinkResolutionScope(resolutionFacade, partSymbol)
symbol = partSymbol
}
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
index 3ddd3150..827062ba 100644
--- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
@@ -9,7 +9,7 @@ import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotated
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.descriptors.impl.EnumEntrySyntheticClassDescriptor
-import org.jetbrains.kotlin.idea.kdoc.KDocFinder
+import org.jetbrains.kotlin.idea.kdoc.findKDoc
import org.jetbrains.kotlin.kdoc.psi.impl.KDocSection
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl
@@ -687,7 +687,7 @@ fun AnnotationDescriptor.mustBeDocumented(): Boolean {
}
fun DeclarationDescriptor.isDocumentationSuppressed(): Boolean {
- val doc = KDocFinder.findKDoc(this)
+ val doc = findKDoc()
if (doc is KDocSection && doc.findTagByName("suppress") != null) return true
return hasSuppressDocTag(sourcePsi())
diff --git a/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt
index 349a44e7..ddfa6621 100644
--- a/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt
@@ -38,7 +38,7 @@ class KotlinAsJavaDocumentationBuilder
}
fun PsiClass.isVisibleInDocumentation() : Boolean {
- val origin: KtDeclaration? = (this as KtLightElement<*, *>).getOrigin()
+ val origin: KtDeclaration? = (this as KtLightElement<*, *>).kotlinOrigin as? KtDeclaration
return origin?.hasModifier(KtTokens.INTERNAL_KEYWORD) != true &&
origin?.hasModifier(KtTokens.PRIVATE_KEYWORD) != true
}
@@ -50,7 +50,7 @@ class KotlinAsJavaDocumentationParser
{
override fun parseDocumentation(element: PsiNamedElement): JavadocParseResult {
val kotlinLightElement = element as? KtLightElement<*, *> ?: return JavadocParseResult.Empty
- val origin = kotlinLightElement.getOrigin() ?: return JavadocParseResult.Empty
+ val origin = kotlinLightElement.kotlinOrigin as? KtDeclaration ?: return JavadocParseResult.Empty
if (origin is KtParameter) {
// LazyDeclarationResolver does not support setter parameters
val grandFather = origin.parent?.parent
diff --git a/core/src/main/kotlin/main.kt b/core/src/main/kotlin/main.kt
index c54255f5..30a33a96 100644
--- a/core/src/main/kotlin/main.kt
+++ b/core/src/main/kotlin/main.kt
@@ -73,7 +73,7 @@ private fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinition {
fun main(args: Array<String>) {
val arguments = DokkaArguments()
- val freeArgs: List<String> = Args.parse(arguments, args) ?: listOf()
+ val freeArgs: List<String> = Args.parse(arguments, args, false) ?: listOf()
val sources = if (arguments.src.isNotEmpty()) arguments.src.split(File.pathSeparatorChar).toList() + freeArgs else freeArgs
val samples = if (arguments.samples.isNotEmpty()) arguments.samples.split(File.pathSeparatorChar).toList() else listOf()
val includes = if (arguments.include.isNotEmpty()) arguments.include.split(File.pathSeparatorChar).toList() else listOf()