[Analysis API FIR] implement reference resolve inside KDoc
^KTIJ-22324 fixed
This commit is contained in:
+1
@@ -9,4 +9,5 @@ import org.jetbrains.kotlin.test.directives.model.SimpleDirectivesContainer
|
||||
|
||||
object AnalysisApiTestDirectives : SimpleDirectivesContainer() {
|
||||
val DISABLE_DEPENDED_MODE by directive("Analysis in dependent mode should not be run in this test")
|
||||
val IGNORE_FE10 by directive("FE10 Analysis API implementation test should mot be run")
|
||||
}
|
||||
+11
@@ -18,7 +18,9 @@ import org.jetbrains.kotlin.analysis.test.framework.project.structure.ktModulePr
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.ExpressionMarkerProvider
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.ExpressionMarkersSourceFilePreprocessor
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.SubstitutionParser
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.libraries.CompilerExecutor
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind
|
||||
import org.jetbrains.kotlin.analysis.test.framework.utils.SkipTestException
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
@@ -104,6 +106,8 @@ abstract class AbstractAnalysisApiBasedTest : TestWithDisposable() {
|
||||
|
||||
useDirectives(*AbstractKotlinCompilerTest.defaultDirectiveContainers.toTypedArray())
|
||||
useDirectives(JvmEnvironmentConfigurationDirectives)
|
||||
useDirectives(CompilerExecutor.Directives)
|
||||
|
||||
|
||||
useSourcePreprocessor(::ExpressionMarkersSourceFilePreprocessor)
|
||||
useAdditionalService { ExpressionMarkerProvider() }
|
||||
@@ -131,6 +135,10 @@ abstract class AbstractAnalysisApiBasedTest : TestWithDisposable() {
|
||||
return
|
||||
}
|
||||
|
||||
if (configurator.frontendKind == FrontendKind.Fe10 && isFe10DisabledForTheTest()) {
|
||||
return
|
||||
}
|
||||
|
||||
doTestByFileStructure(moduleStructure, testServices)
|
||||
}
|
||||
|
||||
@@ -160,6 +168,9 @@ abstract class AbstractAnalysisApiBasedTest : TestWithDisposable() {
|
||||
private fun isDependentModeDisabledForTheTest(): Boolean =
|
||||
AnalysisApiTestDirectives.DISABLE_DEPENDED_MODE in testServices.moduleStructure.allDirectives
|
||||
|
||||
private fun isFe10DisabledForTheTest(): Boolean =
|
||||
AnalysisApiTestDirectives.IGNORE_FE10 in testServices.moduleStructure.allDirectives
|
||||
|
||||
protected fun <R> analyseForTest(contextElement: KtElement, action: KtAnalysisSession.() -> R): R {
|
||||
return if (configurator.analyseInDependentSession) {
|
||||
val originalContainingFile = contextElement.containingKtFile
|
||||
|
||||
+2
@@ -28,6 +28,8 @@ import kotlin.reflect.KClass
|
||||
abstract class AnalysisApiTestConfigurator {
|
||||
open val testPrefix: String? get() = null
|
||||
|
||||
abstract val frontendKind: FrontendKind
|
||||
|
||||
abstract val analyseInDependentSession: Boolean
|
||||
|
||||
abstract fun configureTest(builder: TestConfigurationBuilder, disposable: Disposable)
|
||||
|
||||
Reference in New Issue
Block a user