aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-09-19 22:22:13 +0300
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-09-19 22:22:13 +0300
commitff0c8d7514742b505acff2f2ba51dc21aedbd949 (patch)
tree9bb5427f3c4954364661d212c85cc3a13fc17121
parentbd494a8384ef3e46d6a9e5035c6cac750edcd270 (diff)
downloaddokka-ff0c8d7514742b505acff2f2ba51dc21aedbd949.tar.gz
dokka-ff0c8d7514742b505acff2f2ba51dc21aedbd949.tar.bz2
dokka-ff0c8d7514742b505acff2f2ba51dc21aedbd949.zip
Synchronize to Kotlin compiler API.
-rw-r--r--src/Analysis/AnalysisEnvironment.kt2
-rw-r--r--src/Analysis/CompilerAPI.kt30
2 files changed, 3 insertions, 29 deletions
diff --git a/src/Analysis/AnalysisEnvironment.kt b/src/Analysis/AnalysisEnvironment.kt
index 3ab5a40e..1d51b8a2 100644
--- a/src/Analysis/AnalysisEnvironment.kt
+++ b/src/Analysis/AnalysisEnvironment.kt
@@ -32,7 +32,7 @@ public class AnalysisEnvironment(val messageCollector: MessageCollector, body: A
*/
public fun withContext<T>(processor: (JetCoreEnvironment, ModuleDescriptor, BindingContext) -> T): T {
val environment = JetCoreEnvironment.createForProduction(this, configuration)
- val exhaust = environment.analyze2(messageCollector)
+ val exhaust = environment.analyze()
return processor(environment, exhaust.getModuleDescriptor(), exhaust.getBindingContext())
}
diff --git a/src/Analysis/CompilerAPI.kt b/src/Analysis/CompilerAPI.kt
index 36ccb2f9..032076e5 100644
--- a/src/Analysis/CompilerAPI.kt
+++ b/src/Analysis/CompilerAPI.kt
@@ -27,14 +27,13 @@ private fun getAnnotationsPath(paths: KotlinPaths, arguments: K2JVMCompilerArgum
return annotationsPath
}
-fun JetCoreEnvironment.analyze2(messageCollector: MessageCollector): AnalyzeExhaust {
+fun JetCoreEnvironment.analyze(): AnalyzeExhaust {
val project = getProject()
val sourceFiles = getSourceFiles()
val support = CliLightClassGenerationSupport.getInstanceForCli(project)!!
val sharedTrace = support.getTrace()
val sharedModule = support.newModule()
- val compilerConfiguration = getConfiguration()
- val exhaust = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(project, sourceFiles, sharedTrace,
+ val exhaust = TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(project, sourceFiles, sharedTrace,
Predicates.alwaysFalse<PsiFile>(),
sharedModule,
null,
@@ -42,31 +41,6 @@ fun JetCoreEnvironment.analyze2(messageCollector: MessageCollector): AnalyzeExha
return exhaust
}
-
-
-fun JetCoreEnvironment.analyze(messageCollector: MessageCollector): AnalyzeExhaust {
- val project = getProject()
- val sourceFiles = getSourceFiles()
-
- val analyzerWithCompilerReport = AnalyzerWithCompilerReport(messageCollector)
- analyzerWithCompilerReport.analyzeAndReport(sourceFiles) {
- val support = CliLightClassGenerationSupport.getInstanceForCli(project)!!
- val sharedTrace = support.getTrace()
- val sharedModule = support.newModule()
- val compilerConfiguration = getConfiguration()
- AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(project, sourceFiles, sharedTrace,
- Predicates.alwaysFalse<PsiFile>(),
- sharedModule,
- null,
- null)
- }
-
- val exhaust = analyzerWithCompilerReport.getAnalyzeExhaust()
- assert(exhaust != null) { "AnalyzeExhaust should be non-null, compiling: " + sourceFiles }
-
- return exhaust!!
-}
-
fun BindingContext.getPackageFragment(file: JetFile): PackageFragmentDescriptor? = get(BindingContext.FILE_TO_PACKAGE_FRAGMENT, file)
fun DeclarationDescriptor.isUserCode() =