Intention action for hiddnen declarations fixed
This commit is contained in:
+2
-3
@@ -223,14 +223,13 @@ public class ConflictingExtensionPropertyInspection : AbstractKotlinInspection()
|
||||
}
|
||||
|
||||
private class MarkHiddenAndDeprecatedAction(property: JetProperty) : JetIntentionAction<JetProperty>(property) {
|
||||
override fun getFamilyName() = "Mark with @HiddenDeclaration and @Deprecated"
|
||||
override fun getFamilyName() = "Mark as @Deprecated(..., level = DeprecationLevel.HIDDEN)"
|
||||
override fun getText() = familyName
|
||||
|
||||
override fun invoke(project: Project, editor: Editor?, file: JetFile) {
|
||||
val factory = JetPsiFactory(project)
|
||||
val name = element.nameAsName!!.render()
|
||||
element.addAnnotationWithLineBreak(factory.createAnnotationEntry("@Deprecated(\"Is replaced with automatic synthetic extension\", ReplaceWith(\"$name\"))"))
|
||||
element.addAnnotationWithLineBreak(factory.createAnnotationEntry("@HiddenDeclaration"))
|
||||
element.addAnnotationWithLineBreak(factory.createAnnotationEntry("@Deprecated(\"Is replaced with automatic synthetic extension\", ReplaceWith(\"$name\"), level = DeprecationLevel.HIDDEN)"))
|
||||
}
|
||||
|
||||
//TODO: move into PSI?
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Mark with @HiddenDeclaration and @Deprecated" "true"
|
||||
// "Mark as @Deprecated(..., level = DeprecationLevel.HIDDEN)" "true"
|
||||
import java.io.File
|
||||
|
||||
val File.<caret>name: String
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
// "Mark with @HiddenDeclaration and @Deprecated" "true"
|
||||
// "Mark as @Deprecated(..., level = DeprecationLevel.HIDDEN)" "true"
|
||||
import java.io.File
|
||||
|
||||
@HiddenDeclaration
|
||||
@Deprecated("Is replaced with automatic synthetic extension", ReplaceWith("name"))
|
||||
@Deprecated("Is replaced with automatic synthetic extension", ReplaceWith("name"), level = DeprecationLevel.HIDDEN)
|
||||
val File.<caret>name: String
|
||||
get() = getName()
|
||||
Reference in New Issue
Block a user