mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[devKit] IJ-CR-102194 LightServiceMustBeFinal: highlight the problem as an error
IDEA-236032 GitOrigin-RevId: 869ef0fe709630c7c6ebe6db04ea370dd415edc8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d2c2353529
commit
8b09356f76
@@ -2,6 +2,7 @@
|
||||
package org.jetbrains.idea.devkit.inspections
|
||||
|
||||
import com.intellij.codeInspection.IntentionWrapper
|
||||
import com.intellij.codeInspection.ProblemHighlightType
|
||||
import com.intellij.lang.jvm.DefaultJvmElementVisitor
|
||||
import com.intellij.lang.jvm.JvmClass
|
||||
import com.intellij.lang.jvm.JvmElementVisitor
|
||||
@@ -22,7 +23,7 @@ internal class LightServiceMustBeFinalInspection : DevKitJvmInspection() {
|
||||
if (hasServiceAnnotation && !clazz.hasModifier(JvmModifier.FINAL)) {
|
||||
val actions = createModifierActions(clazz, modifierRequest(JvmModifier.FINAL, true))
|
||||
val fixes = IntentionWrapper.wrapToQuickFixes(actions.toTypedArray(), file)
|
||||
sink.highlight(DevKitBundle.message("inspection.light.service.must.be.final.message"), *fixes)
|
||||
sink.highlight(DevKitBundle.message("inspection.light.service.must.be.final.message"), ProblemHighlightType.GENERIC_ERROR, *fixes)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import com.intellij.openapi.components.Service;
|
||||
|
||||
@Service
|
||||
class <warning descr="Light service must be final">MyService<caret></warning> {
|
||||
class <error descr="Light service must be final">MyService<caret></error> {
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import com.intellij.openapi.components.Service
|
||||
|
||||
@Service
|
||||
open class <warning descr="Light service must be final">MyService<caret></warning>
|
||||
open class <error descr="Light service must be final">MyService<caret></error>
|
||||
Reference in New Issue
Block a user