[LL API] Pass the project instance to ProjectStructureProvider

Eliminate unnecessary PSI tree traversal by providing the 'Project'
instance explicitly.
This commit is contained in:
Yan Zhulanow
2023-05-15 15:58:20 +09:00
committed by Space Team
parent bb37a959d4
commit c6d8876f9f
13 changed files with 26 additions and 19 deletions
@@ -94,7 +94,11 @@ abstract class KtSimpleNameReference(expression: KtSimpleNameExpression) : KtSim
abstract fun getImportAlias(): KtImportAlias?
private fun isAssignmentResolved(project: Project, binaryExpression: KtBinaryExpression): Boolean {
val sourceModule = ProjectStructureProvider.getModule(binaryExpression, contextualModule = null) as? KtSourceModule ?: return false
val sourceModule = ProjectStructureProvider.getModule(project, binaryExpression, contextualModule = null)
if (sourceModule !is KtSourceModule) {
return false
}
val reference = binaryExpression.operationReference.reference ?: return false
val pluginPresenceService = project.getService(KtCompilerPluginsProvider::class.java)
?: error("KtAssignResolutionPresenceService is not available as a service")