File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
src/main/kotlin/cc/unitmesh/devti/practise Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import cc.unitmesh.devti.util.LLMCoroutineScope
8
8
import com.intellij.codeInsight.completion.PrefixMatcher
9
9
import com.intellij.codeInsight.lookup.*
10
10
import com.intellij.codeInsight.lookup.impl.LookupImpl
11
+ import com.intellij.codeInsight.template.TemplateManager
11
12
import com.intellij.openapi.application.runInEdt
12
13
import com.intellij.openapi.application.runReadAction
13
14
import com.intellij.openapi.diagnostic.logger
@@ -36,6 +37,9 @@ class RenameLookupManagerListener(val project: Project) : LookupManagerListener
36
37
// maybe user just typing, we should handle for this
37
38
val originName = (targetElement as ? PsiNameIdentifierOwner )?.name ? : return
38
39
40
+ // avoid user typing in template. only suggest that user refactor the name
41
+ TemplateManager .getInstance(project).getActiveTemplate(editor) ? : return
42
+
39
43
if (originName.isBlank()) return
40
44
41
45
val promptText =
You can’t perform that action at this time.
0 commit comments