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

GitOrigin-RevId: 7abee6d0c815b179475e45e814da7d45bb6dcfce
This commit is contained in:
Nicolay Mitropolsky
2018-08-14 13:10:38 +03:00
committed by intellij-monorepo-bot
parent fd62b42346
commit 396f95abb1
@@ -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
}