Skip to content

Commit 400460a

Browse files
committed
refactor: splify code
1 parent 5f8065c commit 400460a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/main/kotlin/cc/unitmesh/devti/custom/CustomActionBaseIntention.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ import org.apache.velocity.app.Velocity
1919
import java.io.StringWriter
2020

2121
class CustomActionBaseIntention(private val intentionConfig: CustomIntentionConfig) : ChatBaseIntention() {
22-
override fun getText(): String = intentionConfig.title
23-
2422
private val logger = logger<CustomActionBaseIntention>()
2523

26-
override fun getFamilyName(): String = AutoDevBundle.message("autodev.custom.intentions.family")
27-
override fun priority(): Int {
28-
return intentionConfig.priority
29-
}
24+
override fun getText(): String = intentionConfig.title
25+
override fun getFamilyName() = AutoDevBundle.message("autodev.custom.intentions.family")
26+
override fun priority() = intentionConfig.priority
27+
override fun getActionType(): ChatActionType = ChatActionType.CUSTOM_ACTION
3028

3129
override fun isAvailable(project: Project, editor: Editor?, file: PsiFile?): Boolean {
3230
if (editor == null || file == null) return false
@@ -40,8 +38,6 @@ class CustomActionBaseIntention(private val intentionConfig: CustomIntentionConf
4038
}
4139
}
4240

43-
override fun getActionType(): ChatActionType = ChatActionType.CUSTOM_ACTION
44-
4541
override fun invoke(project: Project, editor: Editor?, file: PsiFile?) {
4642
if (editor == null || file == null) return
4743
val withRange = elementWithRange(editor, file, project) ?: return

0 commit comments

Comments
 (0)