File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
core/src/main/kotlin/cc/unitmesh/devti/custom Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,8 @@ class CustomActionBaseIntention(private val intentionConfig: CustomIntentionConf
29
29
override fun isAvailable (project : Project , editor : Editor ? , file : PsiFile ? ): Boolean {
30
30
if (editor == null || file == null ) return false
31
31
32
- val regexString = intentionConfig.matchRegex
33
32
return try {
34
- val regex = Regex (regexString)
35
- regex.matches(file.name)
33
+ Regex (intentionConfig.matchRegex).matches(file.name)
36
34
} catch (e: Exception ) {
37
35
false
38
36
}
@@ -53,13 +51,8 @@ class CustomActionBaseIntention(private val intentionConfig: CustomIntentionConf
53
51
54
52
if (intentionConfig.autoInvoke) {
55
53
sendToChatPanel(project, getActionType(), object : ContextPrompter () {
56
- override fun displayPrompt (): String {
57
- return prompt.displayPrompt
58
- }
59
-
60
- override fun requestPrompt (): String {
61
- return prompt.requestPrompt
62
- }
54
+ override fun displayPrompt (): String = prompt.displayPrompt
55
+ override fun requestPrompt (): String = prompt.requestPrompt
63
56
})
64
57
} else {
65
58
sendToChatPanel(project) { panel, _ ->
You can’t perform that action at this time.
0 commit comments