Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dokka K2 analysis #3094

Merged
merged 30 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1f4db2b
Support K2 Analysis Api
vmishenev Jul 17, 2023
6a676f8
Introduce TypeTranslator
vmishenev Jul 22, 2023
d849de8
Support samles, modules docs, external documentables, FullClassHierar…
vmishenev Jul 24, 2023
d19addc
Parse JavaDoc
vmishenev Jul 25, 2023
8245aea
Support TypeAliased
vmishenev Jul 25, 2023
b5d6d83
Refactor
vmishenev Jul 26, 2023
450aba9
Use `KtModule`
vmishenev Jul 26, 2023
43d7626
Move k2 dependencies to toml
vmishenev Jul 26, 2023
c46fd4b
Reuse tests for symbols
vmishenev Jul 26, 2023
af46f51
Format
vmishenev Jul 26, 2023
61ffac9
Fix tests of other plugins
vmishenev Jul 26, 2023
29dfeea
Reset JDK home
vmishenev Jul 26, 2023
7104e87
Add some minor docs
vmishenev Jul 26, 2023
bc7ba34
Add disposer
vmishenev Jul 28, 2023
718b7e4
Fix API
vmishenev Jul 28, 2023
44d9df7
Fix analysis disposing
vmishenev Aug 11, 2023
78bdf0b
Fix some review comments
vmishenev Aug 11, 2023
654d252
Rebase
vmishenev Aug 11, 2023
a646328
Use `KtSyntheticJavaPropertySymbol` instead of
vmishenev Aug 11, 2023
6488f86
Mute Java tests or using JDK
vmishenev Aug 11, 2023
b47a0c0
Refactor to extract function
vmishenev Aug 12, 2023
9b79b24
Support synthetic KDoc for enum members
vmishenev Aug 14, 2023
aa26380
Resolve KDoc links via Analysis API
vmishenev Aug 16, 2023
61e0309
Make some transitive dependencies `runtimeOnly`
vmishenev Aug 18, 2023
9e65b29
Fix review comments
vmishenev Aug 18, 2023
853083a
Exclude `analysis-kotlin-descriptors` from `baseTestUtils`
vmishenev Aug 18, 2023
5a227fe
Move `plugin` project
vmishenev Aug 19, 2023
8da7ce2
Extract a convention plugin for testing
vmishenev Aug 20, 2023
83d6ad4
Polish code
vmishenev Aug 24, 2023
de2426c
Mute extra tests
vmishenev Aug 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move plugin project
  • Loading branch information
vmishenev committed Aug 19, 2023
commit 5a227febd9d706e8a069ea83c94a4ec49a6673bc
1 change: 0 additions & 1 deletion plugins/base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ dependencies {
descriptorsTestConfiguration(project(path = ":subprojects:analysis-kotlin-descriptors", configuration = "shadow"))
}


val symbolsTest = tasks.register<Test>("symbolsTest") {
useJUnitPlatform {
excludeTags("onlyDescriptors", "onlyDescriptorsMPP", "javaCode", "usingJDK")
Expand Down
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ include(
":subprojects:analysis-kotlin-descriptors:compiler",
":subprojects:analysis-kotlin-descriptors:ide",
":subprojects:analysis-kotlin-symbols",
":subprojects:analysis-kotlin-symbols:plugin",
":subprojects:analysis-markdown-jb",

":runners:gradle-plugin",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
public abstract interface class org/jetbrains/dokka/analysis/kotlin/symbols/plugin/AnalysisContext : java/io/Closeable {
public abstract fun getMainModule ()Lorg/jetbrains/kotlin/analysis/project/structure/KtSourceModule;
public abstract fun getProject ()Lcom/intellij/openapi/project/Project;
}

public abstract class org/jetbrains/dokka/analysis/kotlin/symbols/plugin/KotlinAnalysis : java/io/Closeable {
public fun <init> ()V
public fun <init> (Lorg/jetbrains/dokka/analysis/kotlin/symbols/plugin/KotlinAnalysis;)V
public synthetic fun <init> (Lorg/jetbrains/dokka/analysis/kotlin/symbols/plugin/KotlinAnalysis;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun get (Lorg/jetbrains/dokka/DokkaConfiguration$DokkaSourceSet;)Lorg/jetbrains/dokka/analysis/kotlin/symbols/plugin/AnalysisContext;
}

public final class org/jetbrains/dokka/analysis/kotlin/symbols/plugin/SymbolsAnalysisPlugin : org/jetbrains/dokka/plugability/DokkaPlugin {
public fun <init> ()V
public final fun getKotlinAnalysis ()Lorg/jetbrains/dokka/plugability/ExtensionPoint;
public final fun getSymbolToDocumentableTranslator ()Lorg/jetbrains/dokka/plugability/Extension;
}

public final class org/jetbrains/dokka/analysis/kotlin/symbols/services/KotlinAnalysisSourceRootsExtractor : org/jetbrains/dokka/analysis/java/SourceRootsExtractor {
public fun <init> ()V
public fun extract (Lorg/jetbrains/dokka/DokkaConfiguration$DokkaSourceSet;Lorg/jetbrains/dokka/plugability/DokkaContext;)Ljava/util/List;
}

public class org/jetbrains/dokka/analysis/kotlin/symbols/services/KotlinSampleProvider : org/jetbrains/dokka/analysis/kotlin/internal/SampleProvider {
public fun <init> (Lorg/jetbrains/dokka/plugability/DokkaContext;)V
public fun close ()V
public final fun getContext ()Lorg/jetbrains/dokka/plugability/DokkaContext;
public final fun getKotlinAnalysis ()Lorg/jetbrains/dokka/analysis/kotlin/symbols/plugin/KotlinAnalysis;
public fun getSample (Lorg/jetbrains/dokka/DokkaConfiguration$DokkaSourceSet;Ljava/lang/String;)Lorg/jetbrains/dokka/analysis/kotlin/internal/SampleProvider$SampleSnippet;
protected fun processBody (Lcom/intellij/psi/PsiElement;)Ljava/lang/String;
protected fun processImports (Lcom/intellij/psi/PsiElement;)Ljava/lang/String;
}

public final class org/jetbrains/dokka/analysis/kotlin/symbols/services/KotlinSampleProviderFactory : org/jetbrains/dokka/analysis/kotlin/internal/SampleProviderFactory {
public fun <init> (Lorg/jetbrains/dokka/plugability/DokkaContext;)V
public fun build ()Lorg/jetbrains/dokka/analysis/kotlin/internal/SampleProvider;
public final fun getContext ()Lorg/jetbrains/dokka/plugability/DokkaContext;
}

public final class org/jetbrains/dokka/analysis/kotlin/symbols/services/SymbolFullClassHierarchyBuilder : org/jetbrains/dokka/analysis/kotlin/internal/FullClassHierarchyBuilder {
public fun <init> ()V
public fun build (Lorg/jetbrains/dokka/model/DModule;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class org/jetbrains/dokka/analysis/kotlin/symbols/translators/DefaultSymbolToDocumentableTranslator : org/jetbrains/dokka/transformers/sources/AsyncSourceToDocumentableTranslator {
public fun <init> (Lorg/jetbrains/dokka/plugability/DokkaContext;)V
public fun invoke (Lorg/jetbrains/dokka/DokkaConfiguration$DokkaSourceSet;Lorg/jetbrains/dokka/plugability/DokkaContext;)Lorg/jetbrains/dokka/model/DModule;
public fun invokeSuspending (Lorg/jetbrains/dokka/DokkaConfiguration$DokkaSourceSet;Lorg/jetbrains/dokka/plugability/DokkaContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

69 changes: 68 additions & 1 deletion subprojects/analysis-kotlin-symbols/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,74 @@ plugins {
}

dependencies {
implementation(projects.subprojects.analysisKotlinSymbols.plugin)
compileOnly(projects.core)
compileOnly(projects.subprojects.analysisKotlinApi)

implementation(projects.subprojects.analysisMarkdownJb)
implementation(projects.subprojects.analysisJavaPsi)


// ----------- IDE dependencies ----------------------------------------------------------------------------

listOf(
libs.intellij.platform.util.rt,
libs.intellij.platform.util.api,
libs.intellij.java.psi.api,
libs.intellij.java.psi.impl
).forEach {
runtimeOnly(it) { isTransitive = false }
}

implementation(libs.intellij.java.psi.api) { isTransitive = false }


// TODO move to toml
listOf(
"com.jetbrains.intellij.platform:util-class-loader",
"com.jetbrains.intellij.platform:util-text-matching",
"com.jetbrains.intellij.platform:util-base",
"com.jetbrains.intellij.platform:util-xml-dom",
"com.jetbrains.intellij.platform:core-impl",
"com.jetbrains.intellij.platform:extensions",
).forEach {
runtimeOnly("$it:213.7172.25") { isTransitive = false }
}

implementation("com.jetbrains.intellij.platform:core:213.7172.25") {
isTransitive = false
} // for Standalone prototype

// ----------- Analysis dependencies ----------------------------------------------------------------------------

listOf(
libs.kotlin.high.level.api.api,
libs.kotlin.analysis.api.standalone,
libs.kotlin.high.level.api.impl // for Standalone prototype
).forEach {
implementation(it) {
isTransitive = false // see KTIJ-19820
}
}
listOf(
libs.kotlin.high.level.api.impl,
libs.kotlin.high.level.api.fir,
libs.kotlin.high.level.api.fe10,
libs.kotlin.low.level.api.fir,
libs.kotlin.analysis.project.structure,
libs.kotlin.analysis.api.providers,
libs.kotlin.symbol.light.classes
).forEach {
runtimeOnly(it) {
isTransitive = false // see KTIJ-19820
}
}
runtimeOnly(libs.kotlinx.collections.immutable)
implementation(libs.kotlin.compiler.k2) {
isTransitive = false
}

// TODO [beresnev] get rid of it
compileOnly(libs.kotlinx.coroutines.core)
}

tasks {
Expand Down
50 changes: 0 additions & 50 deletions subprojects/analysis-kotlin-symbols/plugin/api/plugin.api

This file was deleted.

74 changes: 0 additions & 74 deletions subprojects/analysis-kotlin-symbols/plugin/build.gradle.kts

This file was deleted.