KotlinLanguageInjectionSupport: remove calling replaceInjectionsWithUndo on removing of in-place injection
This commit is contained in:
+8
-7
@@ -76,15 +76,16 @@ class KotlinLanguageInjectionSupport : AbstractLanguageInjectionSupport() {
|
|||||||
|
|
||||||
val project = psiElement.getProject()
|
val project = psiElement.getProject()
|
||||||
|
|
||||||
val injectionAnnotation = findAnnotationInjection(psiElement)
|
val injectInstructions = listOfNotNull(
|
||||||
val injectionComment = findInjectionComment(psiElement)
|
findAnnotationInjection(psiElement),
|
||||||
|
findInjectionComment(psiElement)
|
||||||
val injectInstructions = listOf(injectionAnnotation, injectionComment).filterNotNull()
|
)
|
||||||
|
|
||||||
val configuration = Configuration.getProjectInstance(project)
|
|
||||||
|
|
||||||
TemporaryPlacesRegistry.getInstance(project).removeHostWithUndo(project, psiElement)
|
TemporaryPlacesRegistry.getInstance(project).removeHostWithUndo(project, psiElement)
|
||||||
configuration.replaceInjectionsWithUndo(project, listOf(), listOf(), injectInstructions)
|
|
||||||
|
project.executeWriteCommand("remove injection in-code instructions") {
|
||||||
|
injectInstructions.forEach(PsiElement::delete)
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user