FIR IDE: do not use FE1.0 compiler jars in frontend-independent-modules

This commit is contained in:
Ilya Kirillov
2021-09-12 19:18:24 +02:00
parent da962895a8
commit a8d321db63
5 changed files with 42 additions and 23 deletions
@@ -1,26 +0,0 @@
/*
* Copyright 2010-2019 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.analyzer
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.ModificationTracker
import org.jetbrains.kotlin.psi.KtFile
open class KotlinModificationTrackerService {
open val modificationTracker: ModificationTracker = ModificationTracker.NEVER_CHANGED
open val outOfBlockModificationTracker: ModificationTracker = ModificationTracker.NEVER_CHANGED
open fun fileModificationTracker(file: KtFile): ModificationTracker = ModificationTracker.NEVER_CHANGED
companion object {
private val NEVER_CHANGE_TRACKER_SERVICE = KotlinModificationTrackerService()
@JvmStatic
fun getInstance(project: Project): KotlinModificationTrackerService {
return ServiceManager.getService(project, KotlinModificationTrackerService::class.java) ?: NEVER_CHANGE_TRACKER_SERVICE
}
}
}
@@ -28,25 +28,11 @@ import org.jetbrains.kotlin.util.OperatorNameConventions
object DataClassDescriptorResolver {
val COPY_METHOD_NAME = Name.identifier("copy")
private val COMPONENT_FUNCTION_NAME_PREFIX = "component"
fun createComponentName(index: Int): Name = DataClassResolver.createComponentName(index)
fun createComponentName(index: Int): Name = Name.identifier(COMPONENT_FUNCTION_NAME_PREFIX + index)
fun getComponentIndex(componentName: String): Int = DataClassResolver.getComponentIndex(componentName)
fun getComponentIndex(componentName: String): Int = componentName.substring(COMPONENT_FUNCTION_NAME_PREFIX.length).toInt()
fun isComponentLike(name: Name): Boolean = isComponentLike(name.asString())
private fun isComponentLike(name: String): Boolean {
if (!name.startsWith(COMPONENT_FUNCTION_NAME_PREFIX)) return false
try {
getComponentIndex(name)
} catch (e: NumberFormatException) {
return false
}
return true
}
fun isComponentLike(name: Name): Boolean = DataClassResolver.isComponentLike(name)
fun createComponentFunctionDescriptor(
parameterIndex: Int,