aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/build.gradle5
-rw-r--r--core/src/main/kotlin/Analysis/AnalysisEnvironment.kt3
-rw-r--r--core/src/main/kotlin/Generation/DokkaGenerator.kt9
-rw-r--r--core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt4
-rw-r--r--core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt4
-rw-r--r--core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt2
-rw-r--r--core/src/test/kotlin/TestAPI.kt4
7 files changed, 22 insertions, 9 deletions
diff --git a/core/build.gradle b/core/build.gradle
index f5822725..72eb6baf 100644
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -26,11 +26,12 @@ dependencies {
compile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: kotlin_version
compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_version
- compile "com.google.inject:guice:4.1.0"
+ compile group: 'com.google.inject', name: 'guice', version: '3.0'
compile "org.jsoup:jsoup:1.8.3"
compile files("../lib/intellij-core-analysis.jar")
compile files("../lib/kotlin-compiler.jar")
+ compile files("../lib/kotlin-script-runtime.jar")
compile files("../lib/kotlin-ide-common.jar")
compile files("../lib/markdown.jar")
compile files("../lib/picocontainer.jar")
@@ -46,6 +47,8 @@ dependencies {
//tools.jar
provided files(((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs().findAll { it.path.endsWith("jar") })
+
+
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_version
}
diff --git a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt
index c6fb0b5c..d3abf41f 100644
--- a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt
+++ b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt
@@ -166,6 +166,9 @@ fun contentRootFromPath(path: String): ContentRoot {
class DokkaResolutionFacade(override val project: Project,
override val moduleDescriptor: ModuleDescriptor,
val resolverForModule: ResolverForModule) : ResolutionFacade {
+ override fun analyze(elements: Collection<KtElement>, bodyResolveMode: BodyResolveMode): BindingContext {
+ throw UnsupportedOperationException()
+ }
val resolveSession: ResolveSession get() = getFrontendService(ResolveSession::class.java)
diff --git a/core/src/main/kotlin/Generation/DokkaGenerator.kt b/core/src/main/kotlin/Generation/DokkaGenerator.kt
index 8d846904..360965d5 100644
--- a/core/src/main/kotlin/Generation/DokkaGenerator.kt
+++ b/core/src/main/kotlin/Generation/DokkaGenerator.kt
@@ -7,7 +7,6 @@ import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.psi.PsiFile
import com.intellij.psi.PsiJavaFile
import com.intellij.psi.PsiManager
-import org.jetbrains.dokka.*
import org.jetbrains.dokka.Utilities.DokkaModule
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
@@ -16,7 +15,7 @@ import org.jetbrains.kotlin.cli.common.messages.MessageRenderer
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot
import org.jetbrains.kotlin.config.JVMConfigurationKeys
-import org.jetbrains.kotlin.resolve.LazyTopDownAnalyzerForTopLevel
+import org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer
import org.jetbrains.kotlin.resolve.TopDownAnalysisMode
import org.jetbrains.kotlin.utils.PathUtil
import java.io.File
@@ -84,6 +83,10 @@ class DokkaGenerator(val logger: DokkaLogger,
}
class DokkaMessageCollector(val logger: DokkaLogger): MessageCollector {
+ override fun clear() {
+ seenErrors = false
+ }
+
private var seenErrors = false
override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageLocation) {
@@ -105,7 +108,7 @@ fun buildDocumentationModule(injector: Injector,
val fragmentFiles = coreEnvironment.getSourceFiles().filter(filesToDocumentFilter)
val resolutionFacade = injector.getInstance(DokkaResolutionFacade::class.java)
- val analyzer = resolutionFacade.getFrontendService(LazyTopDownAnalyzerForTopLevel::class.java)
+ val analyzer = resolutionFacade.getFrontendService(LazyTopDownAnalyzer::class.java)
analyzer.analyzeDeclarations(TopDownAnalysisMode.TopLevelDeclarations, fragmentFiles)
val fragments = fragmentFiles
diff --git a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt
index f1d6665e..806e9f92 100644
--- a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt
+++ b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt
@@ -4,8 +4,8 @@ import com.google.inject.Inject
import com.intellij.psi.*
import com.intellij.psi.util.InheritanceUtil
import com.intellij.psi.util.PsiTreeUtil
-import org.jetbrains.kotlin.asJava.KtLightDeclaration
-import org.jetbrains.kotlin.asJava.KtLightElement
+import org.jetbrains.kotlin.asJava.elements.KtLightDeclaration
+import org.jetbrains.kotlin.asJava.elements.KtLightElement
import org.jetbrains.kotlin.kdoc.parser.KDocKnownTag
import org.jetbrains.kotlin.kdoc.psi.impl.KDocTag
import org.jetbrains.kotlin.lexer.KtTokens
diff --git a/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt b/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt
index 80e02c0c..941d071d 100644
--- a/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt
+++ b/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt
@@ -100,10 +100,10 @@ class DescriptorDocumentationParser
deepestDescriptor = deepestDescriptor.overriddenDescriptors.first()
}
if (DescriptorUtils.getFqName(deepestDescriptor.containingDeclaration).asString() == "kotlin.Any") {
- val anyClassDescriptors = resolutionFacade.resolveSession.getTopLevelClassDescriptors(
+ val anyClassDescriptors = resolutionFacade.resolveSession.getTopLevelClassifierDescriptors(
FqName.fromSegments(listOf("kotlin", "Any")), NoLookupLocation.FROM_IDE)
anyClassDescriptors.forEach {
- val anyMethod = it.getMemberScope(listOf())
+ val anyMethod = (it as ClassDescriptor).getMemberScope(listOf())
.getDescriptorsFiltered(DescriptorKindFilter.FUNCTIONS, { it == descriptor.name })
.single()
val kdoc = anyMethod.findKDoc()
diff --git a/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt
index 304b2bf2..c7ed8292 100644
--- a/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt
@@ -5,7 +5,7 @@ import com.intellij.psi.JavaPsiFacade
import com.intellij.psi.PsiClass
import com.intellij.psi.PsiNamedElement
import org.jetbrains.dokka.Kotlin.DescriptorDocumentationParser
-import org.jetbrains.kotlin.asJava.KtLightElement
+import org.jetbrains.kotlin.asJava.elements.KtLightElement
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.name.FqName
diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt
index 43a335fc..508d28fc 100644
--- a/core/src/test/kotlin/TestAPI.kt
+++ b/core/src/test/kotlin/TestAPI.kt
@@ -23,6 +23,10 @@ fun verifyModel(vararg roots: ContentRoot,
includeNonPublic: Boolean = true,
verifier: (DocumentationModule) -> Unit) {
val messageCollector = object : MessageCollector {
+ override fun clear() {
+
+ }
+
override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageLocation) {
when (severity) {
CompilerMessageSeverity.WARNING,