[devkit] Introduce method

GitOrigin-RevId: 41cbe7fd2a449d58e459e713c1322d461a9a23d6
This commit is contained in:
Andrey Cherkasov
2023-12-13 20:03:25 +00:00
committed by intellij-monorepo-bot
parent 1a5d419d00
commit 266ff1b037
2 changed files with 4 additions and 2 deletions
@@ -79,7 +79,7 @@ internal class MismatchedLightServiceLevelAndCtorInspection : DevKitJvmInspectio
private fun registerProblemProjectLevelRequired(annotation: JvmAnnotation,
elementToReport: PsiJavaCodeReferenceElement,
file: PsiFile) {
val projectLevelFqn = "${Service.Level::class.java.canonicalName}.${Service.Level.PROJECT}"
val projectLevelFqn = getProjectLevelFQN()
val request = constantAttribute(DEFAULT_REFERENCED_METHOD_NAME, projectLevelFqn)
val text = DevKitBundle.message("inspection.mismatched.light.service.level.and.ctor.specify.project.level.fix")
val actions = createChangeAnnotationAttributeActions(annotation, 0, request, text, text)
@@ -137,4 +137,6 @@ fun toLevel(name: String): Service.Level? {
internal fun isLightService(uClass: UClass): Boolean {
return uClass.findAnnotation(Service::class.java.canonicalName) != null
}
}
fun getProjectLevelFQN(): String = "${Service.Level::class.java.canonicalName}.${Service.Level.PROJECT}"