Add analyzeFullyAndGetResult to ResolutionFacade
This commit is contained in:
@@ -60,6 +60,10 @@ public class KotlinCacheService(val project: Project) {
|
||||
override fun resolveToDescriptor(declaration: JetDeclaration): DeclarationDescriptor {
|
||||
return cache.getLazyResolveSession(declaration).resolveToDescriptor(declaration)
|
||||
}
|
||||
|
||||
override fun analyzeFullyAndGetResult(elements: Collection<JetElement>): AnalysisResult {
|
||||
return cache.getAnalysisResultsForElements(elements)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,14 @@ import org.jetbrains.jet.lang.resolve.BindingContext
|
||||
import org.jetbrains.jet.lang.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.jet.lang.psi.JetDeclaration
|
||||
import org.jetbrains.jet.analyzer.AnalysisResult
|
||||
|
||||
public trait ResolutionFacade {
|
||||
|
||||
public fun analyze(element: JetElement): BindingContext
|
||||
|
||||
public fun analyzeFullyAndGetResult(elements: Collection<JetElement>): AnalysisResult
|
||||
|
||||
public fun resolveToDescriptor(declaration: JetDeclaration): DeclarationDescriptor
|
||||
|
||||
public fun findModuleDescriptor(element: JetElement): ModuleDescriptor
|
||||
|
||||
@@ -50,5 +50,5 @@ public fun JetElement.analyzeFully(): BindingContext {
|
||||
}
|
||||
|
||||
public fun JetElement.analyzeFullyAndGetResult(vararg extraFiles: JetFile): AnalysisResult {
|
||||
return KotlinCacheService.getInstance(getProject()).getAnalysisResults(listOf(this) + extraFiles.toList())
|
||||
return KotlinCacheService.getInstance(getProject()).getResolutionFacade(listOf(this) + extraFiles.toList()).analyzeFullyAndGetResult(listOf(this))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user