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) {
|
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 getText() = familyName
|
||||||
|
|
||||||
override fun invoke(project: Project, editor: Editor?, file: JetFile) {
|
override fun invoke(project: Project, editor: Editor?, file: JetFile) {
|
||||||
val factory = JetPsiFactory(project)
|
val factory = JetPsiFactory(project)
|
||||||
val name = element.nameAsName!!.render()
|
val name = element.nameAsName!!.render()
|
||||||
element.addAnnotationWithLineBreak(factory.createAnnotationEntry("@Deprecated(\"Is replaced with automatic synthetic extension\", ReplaceWith(\"$name\"))"))
|
element.addAnnotationWithLineBreak(factory.createAnnotationEntry("@Deprecated(\"Is replaced with automatic synthetic extension\", ReplaceWith(\"$name\"), level = DeprecationLevel.HIDDEN)"))
|
||||||
element.addAnnotationWithLineBreak(factory.createAnnotationEntry("@HiddenDeclaration"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: move into PSI?
|
//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
|
import java.io.File
|
||||||
|
|
||||||
val File.<caret>name: String
|
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
|
import java.io.File
|
||||||
|
|
||||||
@HiddenDeclaration
|
@Deprecated("Is replaced with automatic synthetic extension", ReplaceWith("name"), level = DeprecationLevel.HIDDEN)
|
||||||
@Deprecated("Is replaced with automatic synthetic extension", ReplaceWith("name"))
|
|
||||||
val File.<caret>name: String
|
val File.<caret>name: String
|
||||||
get() = getName()
|
get() = getName()
|
||||||
Reference in New Issue
Block a user