[Analysis API FE10] introduce an exception which marks some parts of the Analysis API as not supported for K1
This commit is contained in:
committed by
Space Team
parent
9dcd142f0d
commit
0fb3c033e7
+3
-2
@@ -10,6 +10,7 @@ import com.intellij.psi.search.GlobalSearchScope
|
|||||||
import org.jetbrains.kotlin.analysis.api.KtAnalysisApiInternals
|
import org.jetbrains.kotlin.analysis.api.KtAnalysisApiInternals
|
||||||
import org.jetbrains.kotlin.analysis.api.KtAnalysisNonPublicApi
|
import org.jetbrains.kotlin.analysis.api.KtAnalysisNonPublicApi
|
||||||
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
||||||
|
import org.jetbrains.kotlin.analysis.api.NotSupportedForK1Exception
|
||||||
import org.jetbrains.kotlin.analysis.api.components.*
|
import org.jetbrains.kotlin.analysis.api.components.*
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.components.*
|
import org.jetbrains.kotlin.analysis.api.descriptors.components.*
|
||||||
import org.jetbrains.kotlin.analysis.api.impl.base.components.KtAnalysisScopeProviderImpl
|
import org.jetbrains.kotlin.analysis.api.impl.base.components.KtAnalysisScopeProviderImpl
|
||||||
@@ -73,11 +74,11 @@ class KtFe10AnalysisSession(
|
|||||||
override val compilerFacilityImpl: KtCompilerFacility = KtFe10CompilerFacility(this)
|
override val compilerFacilityImpl: KtCompilerFacility = KtFe10CompilerFacility(this)
|
||||||
|
|
||||||
override val metadataCalculatorImpl: KtMetadataCalculator
|
override val metadataCalculatorImpl: KtMetadataCalculator
|
||||||
get() = throw UnsupportedOperationException()
|
get() = throw NotSupportedForK1Exception()
|
||||||
|
|
||||||
@Suppress("AnalysisApiMissingLifetimeCheck")
|
@Suppress("AnalysisApiMissingLifetimeCheck")
|
||||||
override val substitutorProviderImpl: KtSubstitutorProvider
|
override val substitutorProviderImpl: KtSubstitutorProvider
|
||||||
get() = throw UnsupportedOperationException()
|
get() = throw NotSupportedForK1Exception()
|
||||||
|
|
||||||
override fun createContextDependentCopy(originalKtFile: KtFile, elementToReanalyze: KtElement): KtAnalysisSession =
|
override fun createContextDependentCopy(originalKtFile: KtFile, elementToReanalyze: KtElement): KtAnalysisSession =
|
||||||
KtFe10AnalysisSession(originalKtFile.project, elementToReanalyze, token)
|
KtFe10AnalysisSession(originalKtFile.project, elementToReanalyze, token)
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.analysis.api
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception indicating that a certain operation is not supported for the K1 version of Analysis API
|
||||||
|
*/
|
||||||
|
public class NotSupportedForK1Exception : UnsupportedOperationException()
|
||||||
Reference in New Issue
Block a user