Reapply "Introduce @FrontendInternals annotation""

This reverts commit 9ca4717d11.
^KT-39643 Fixed
This commit is contained in:
Pavel Kirpichenkov
2020-08-10 12:14:01 +03:00
parent 5e8e60a399
commit f431da2a66
52 changed files with 214 additions and 57 deletions
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.container.ComponentProvider
import org.jetbrains.kotlin.container.getService
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.idea.FrontendInternals
import org.jetbrains.kotlin.idea.resolve.ResolutionFacade
import org.jetbrains.kotlin.psi.KtDeclaration
import org.jetbrains.kotlin.psi.KtElement
@@ -38,6 +39,7 @@ class KotlinResolutionFacadeForRepl(
override val moduleDescriptor: ModuleDescriptor = provider.getService(ModuleDescriptor::class.java)
@FrontendInternals
override fun <T : Any> getFrontendService(serviceClass: Class<T>): T {
return provider.resolve(serviceClass)!!.getValue() as T
}
@@ -46,6 +48,7 @@ class KotlinResolutionFacadeForRepl(
throw UnsupportedOperationException()
}
@FrontendInternals
override fun <T : Any> tryGetFrontendService(element: PsiElement, serviceClass: Class<T>): T? {
throw UnsupportedOperationException()
}
@@ -54,10 +57,12 @@ class KotlinResolutionFacadeForRepl(
throw UnsupportedOperationException()
}
@FrontendInternals
override fun <T : Any> getFrontendService(element: PsiElement, serviceClass: Class<T>): T {
throw UnsupportedOperationException()
}
@FrontendInternals
override fun <T : Any> getFrontendService(moduleDescriptor: ModuleDescriptor, serviceClass: Class<T>): T {
throw UnsupportedOperationException()
}