diff options
| author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-14 15:44:32 +0400 |
|---|---|---|
| committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-14 15:44:32 +0400 |
| commit | 08e690021ce2df402134ea5cebd769183499c771 (patch) | |
| tree | 5c8c95a9fcc26bb31e65cb08ac762980e46e1040 /src/Analysis | |
| parent | 71aacc5719cf59d2284592018177fbf8d71d12e4 (diff) | |
| download | dokka-08e690021ce2df402134ea5cebd769183499c771.tar.gz dokka-08e690021ce2df402134ea5cebd769183499c771.tar.bz2 dokka-08e690021ce2df402134ea5cebd769183499c771.zip | |
Migrate to PackageView processing to unify all package fragments into single item.
Diffstat (limited to 'src/Analysis')
| -rw-r--r-- | src/Analysis/AnalysisEnvironment.kt | 6 | ||||
| -rw-r--r-- | src/Analysis/CompilerAPI.kt | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Analysis/AnalysisEnvironment.kt b/src/Analysis/AnalysisEnvironment.kt index 20c1a764..d657ae4a 100644 --- a/src/Analysis/AnalysisEnvironment.kt +++ b/src/Analysis/AnalysisEnvironment.kt @@ -20,14 +20,14 @@ public class AnalysisEnvironment(val messageCollector: MessageCollector, body: A body() } - private fun withContext<T>(processor: (JetCoreEnvironment, ModuleDescriptor, BindingContext) -> T): T { + public fun withContext<T>(processor: (JetCoreEnvironment, ModuleDescriptor, BindingContext) -> T): T { val environment = JetCoreEnvironment.createForProduction(this, configuration) val exhaust = environment.analyze(messageCollector) return processor(environment, exhaust.getModuleDescriptor(), exhaust.getBindingContext()) } - public fun withContext<T>(processor: (BindingContext) -> T): T { - return withContext { environment, module, context -> processor(context) } + public fun withContext<T>(processor: (ModuleDescriptor, BindingContext) -> T): T { + return withContext { environment, module, context -> processor(module, context) } } public fun streamFiles<T>(processor: (BindingContext, JetFile) -> T): Stream<T> { diff --git a/src/Analysis/CompilerAPI.kt b/src/Analysis/CompilerAPI.kt index bc0e6e93..b2b9a824 100644 --- a/src/Analysis/CompilerAPI.kt +++ b/src/Analysis/CompilerAPI.kt @@ -53,10 +53,11 @@ fun JetCoreEnvironment.analyze(messageCollector: MessageCollector): AnalyzeExhau fun AnalyzerWithCompilerReport.analyzeAndReport(files: List<JetFile>, analyser: () -> AnalyzeExhaust) = analyzeAndReport(analyser, files) -fun BindingContext.getPackageFragment(file: JetFile) = get(BindingContext.FILE_TO_PACKAGE_FRAGMENT, file) +fun BindingContext.getPackageFragment(file: JetFile) : PackageFragmentDescriptor? = get(BindingContext.FILE_TO_PACKAGE_FRAGMENT, file) fun DeclarationDescriptor.isUserCode() = when (this) { + is PackageViewDescriptor -> false is PackageFragmentDescriptor -> false is PropertyAccessorDescriptor -> !isDefault() is CallableMemberDescriptor -> getKind() == CallableMemberDescriptor.Kind.DECLARATION |
