KTIJ-26423 [AA] Return more info from KtFirImportOptimizer

Deprecate `unusedImports`, since they are supposed to be computed
on the IDE side from now on based on the information from
Analysis API

Currently the `unusedImports` property is not removed completely
so it can still be used by the Kotlin side import optimizer
tests; they should be moved/adapted to the intellij repository
also
This commit is contained in:
Roman Golyshev
2023-07-27 16:23:38 +02:00
committed by teamcity
parent 43180597fe
commit 10df37ba8e
3 changed files with 12 additions and 5 deletions
@@ -7,6 +7,8 @@ package org.jetbrains.kotlin.analysis.api.components
import org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeOwner
import org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtImportDirective
@@ -28,5 +30,8 @@ public interface KtImportOptimizerMixIn : KtAnalysisSessionMixIn {
}
public class KtImportOptimizerResult(
public val unusedImports: Set<KtImportDirective>,
@Deprecated("Compute unused import on the IntelliJ side instead, see org.jetbrains.kotlin.idea.base.analysis.api.utils.computeUnusedImports")
public val unusedImports: Set<KtImportDirective> = emptySet(),
public val usedDeclarations: Map<FqName, Set<Name>> = emptyMap(),
public val unresolvedNames: Set<Name> = emptySet(),
)