KotlinLanguageInjectionSupport: remove calling replaceInjectionsWithUndo on removing of in-place injection

This commit is contained in:
Nicolay Mitropolsky
2018-08-13 19:09:05 +03:00
parent cd047b9605
commit e92d3998de
@@ -76,15 +76,16 @@ class KotlinLanguageInjectionSupport : AbstractLanguageInjectionSupport() {
val project = psiElement.getProject()
val injectionAnnotation = findAnnotationInjection(psiElement)
val injectionComment = findInjectionComment(psiElement)
val injectInstructions = listOf(injectionAnnotation, injectionComment).filterNotNull()
val configuration = Configuration.getProjectInstance(project)
val injectInstructions = listOfNotNull(
findAnnotationInjection(psiElement),
findInjectionComment(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
}