diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/build.gradle | 6 | ||||
-rw-r--r-- | core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt | 14 | ||||
-rw-r--r-- | core/src/main/kotlin/Kotlin/DocumentationBuilder.kt | 4 | ||||
-rw-r--r-- | core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt | 4 | ||||
-rw-r--r-- | core/src/main/kotlin/main.kt | 2 | ||||
-rw-r--r-- | core/src/test/kotlin/TestAPI.kt | 3 | ||||
-rw-r--r-- | core/testdata/format/javaCodeInParam.md | 5 | ||||
-rw-r--r-- | core/testdata/format/javaCodeLiteralTags.md | 11 | ||||
-rw-r--r-- | core/testdata/format/javaLinkTag.html | 3 | ||||
-rw-r--r-- | core/testdata/format/javaLinkTagWithLabel.html | 3 | ||||
-rw-r--r-- | core/testdata/format/javaSeeTag.html | 3 | ||||
-rw-r--r-- | core/testdata/format/javaSpaceInAuthor.md | 5 | ||||
-rw-r--r-- | core/testdata/format/javadocHtml.md | 15 | ||||
-rw-r--r-- | core/testdata/format/javadocOrderedList.md | 8 |
14 files changed, 65 insertions, 21 deletions
diff --git a/core/build.gradle b/core/build.gradle index 334b7fc8..d3ba259f 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -47,8 +47,12 @@ dependencies { compile "org.jsoup:jsoup:1.8.3" compile "org.apache.ant:ant:1.9.6" + compile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: kotlin_version + compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_version + compile files("../lib/intellij-core-analysis.jar") - compile files("../lib/kotlin-for-upsource.jar") + compile files("../lib/kotlin-compiler.jar") + compile files("../lib/kotlin-ide-common.jar") compile files("../lib/markdown.jar") compile files("../lib/picocontainer.jar") 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() diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt index b14e4aa9..ab2a526b 100644 --- a/core/src/test/kotlin/TestAPI.kt +++ b/core/src/test/kotlin/TestAPI.kt @@ -47,6 +47,9 @@ public fun verifyModel(vararg roots: ContentRoot, if (withKotlinRuntime) { val kotlinPairRoot = PathManager.getResourceRoot(Pair::class.java, "/kotlin/Pair.class") addClasspath(File(kotlinPairRoot)) + + val kotlinStrictfpRoot = PathManager.getResourceRoot(Strictfp::class.java, "/kotlin/jvm/Strictfp.class") + addClasspath(File(kotlinStrictfpRoot)) } addRoots(roots.toList()) } diff --git a/core/testdata/format/javaCodeInParam.md b/core/testdata/format/javaCodeInParam.md index b1d2d871..02d5d974 100644 --- a/core/testdata/format/javaCodeInParam.md +++ b/core/testdata/format/javaCodeInParam.md @@ -17,5 +17,8 @@ ### Constructors -| [<init>](test/-c/-init-) | `C()` | +| [<init>](test/-c/-init-) | `C()` + + + | diff --git a/core/testdata/format/javaCodeLiteralTags.md b/core/testdata/format/javaCodeLiteralTags.md index 83c9cc33..a705a01c 100644 --- a/core/testdata/format/javaCodeLiteralTags.md +++ b/core/testdata/format/javaCodeLiteralTags.md @@ -19,5 +19,14 @@ A<B>C ### Constructors -| [<init>](test/-c/-init-) | `C()` | +| [<init>](test/-c/-init-) | `C()` + +`A<B>C` + + +A<B>C + + + + | diff --git a/core/testdata/format/javaLinkTag.html b/core/testdata/format/javaLinkTag.html index d2b956a1..997e52ab 100644 --- a/core/testdata/format/javaLinkTag.html +++ b/core/testdata/format/javaLinkTag.html @@ -17,7 +17,8 @@ <td> <a href="test/-foo/-init-"><init></a></td> <td> -<code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code></td> +<code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code><p>Call <code><a href="test/-foo/bar">#bar()</a></code> to do the job. </p> +</td> </tr> </tbody> </table> diff --git a/core/testdata/format/javaLinkTagWithLabel.html b/core/testdata/format/javaLinkTagWithLabel.html index c3685ad1..fdddadf9 100644 --- a/core/testdata/format/javaLinkTagWithLabel.html +++ b/core/testdata/format/javaLinkTagWithLabel.html @@ -17,7 +17,8 @@ <td> <a href="test/-foo/-init-"><init></a></td> <td> -<code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code></td> +<code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code><p>Call <code><a href="test/-foo/bar">this wonderful method</a></code> to do the job. </p> +</td> </tr> </tbody> </table> diff --git a/core/testdata/format/javaSeeTag.html b/core/testdata/format/javaSeeTag.html index 3269c5a0..e22e8452 100644 --- a/core/testdata/format/javaSeeTag.html +++ b/core/testdata/format/javaSeeTag.html @@ -19,7 +19,8 @@ <td> <a href="test/-foo/-init-"><init></a></td> <td> -<code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code></td> +<code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code><p></p> +</td> </tr> </tbody> </table> diff --git a/core/testdata/format/javaSpaceInAuthor.md b/core/testdata/format/javaSpaceInAuthor.md index e464f0a0..ddaaa35d 100644 --- a/core/testdata/format/javaSpaceInAuthor.md +++ b/core/testdata/format/javaSpaceInAuthor.md @@ -17,5 +17,8 @@ Dmitry Jemerov ### Constructors -| [<init>](test/-c/-init-) | `C()` | +| [<init>](test/-c/-init-) | `C()` + + + | diff --git a/core/testdata/format/javadocHtml.md b/core/testdata/format/javadocHtml.md index 3e92441b..15b86bb4 100644 --- a/core/testdata/format/javadocHtml.md +++ b/core/testdata/format/javadocHtml.md @@ -23,5 +23,18 @@ Block code ### Constructors -| [<init>](test/-c/-init-) | `C()` | +| [<init>](test/-c/-init-) | `C()` +**Bold** **Strong** *Italic* *Emphasized* +Paragraph + + ~~Strikethrough~~ ~~Deleted~~ `Code` +``` +Block code +``` + + * List Item + + + + | diff --git a/core/testdata/format/javadocOrderedList.md b/core/testdata/format/javadocOrderedList.md index 02a3c095..415e3479 100644 --- a/core/testdata/format/javadocOrderedList.md +++ b/core/testdata/format/javadocOrderedList.md @@ -16,5 +16,11 @@ ### Constructors -| [<init>](test/-bar/-init-) | `Bar()` | +| [<init>](test/-bar/-init-) | `Bar()` + 1. Rinse + 1. Repeat + + + + | |