Refactoring NoArg compiler plugin

Remove NoArgClassKey relation betwen AbstractNoArgDeclarationChecker and NoArgExpressionCodegenExtension
Separate NoArgExpressionCodegenExtension to Ide and Cli versions
This commit is contained in:
Igor Yakovlev
2019-09-19 19:20:06 +03:00
parent 027c60080b
commit 1deba19e1c
9 changed files with 46 additions and 53 deletions
@@ -0,0 +1,21 @@
/*
* 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.noarg.ide
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.annotation.plugin.ide.CachedAnnotationNames
import org.jetbrains.kotlin.annotation.plugin.ide.getAnnotationNames
import org.jetbrains.kotlin.noarg.AbstractNoArgExpressionCodegenExtension
import org.jetbrains.kotlin.psi.KtModifierListOwner
class IdeNoArgExpressionCodegenExtension(project: Project) :
AbstractNoArgExpressionCodegenExtension(invokeInitializers = false) {
private val cachedAnnotationsNames = CachedAnnotationNames(project, NO_ARG_ANNOTATION_OPTION_PREFIX)
override fun getAnnotationFqNames(modifierListOwner: KtModifierListOwner?): List<String> =
cachedAnnotationsNames.getAnnotationNames(modifierListOwner)
}