Reorganize TypeAttributeTranslatorExtension

This commit is contained in:
Irene Dea
2021-11-23 15:46:12 -08:00
committed by Dmitriy Novozhilov
parent 19bfc43bee
commit 374d287d08
11 changed files with 39 additions and 35 deletions
+1
View File
@@ -7,6 +7,7 @@ dependencies {
api(project(":compiler:util"))
api(project(":core:descriptors"))
api(project(":compiler:resolution.common"))
compileOnly(intellijCore())
compileOnly(commonDependency("org.jetbrains.intellij.deps:trove4j"))
}
@@ -0,0 +1,24 @@
/*
* Copyright 2010-2021 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.extensions
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.types.DefaultTypeAttributeTranslator
import org.jetbrains.kotlin.types.TypeAttributeTranslator
import org.jetbrains.kotlin.types.extensions.TypeAttributeTranslators
interface TypeAttributeTranslatorExtension : TypeAttributeTranslator {
companion object : ProjectExtensionDescriptor<TypeAttributeTranslatorExtension>(
"org.jetbrains.kotlin.extensions.typeAttributeTranslatorExtension",
TypeAttributeTranslatorExtension::class.java
) {
val Default = TypeAttributeTranslators(listOf(DefaultTypeAttributeTranslator))
fun createTranslators(project: Project): TypeAttributeTranslators {
return TypeAttributeTranslators(getInstances(project) + DefaultTypeAttributeTranslator)
}
}
}