Create from Usage: Do not delete temporary file as this operation is not supported by IDEA anymore

This commit is contained in:
Alexey Sedunov
2015-04-16 13:40:08 +03:00
committed by Nikolay Krasko
parent 8e51f1aadd
commit 73b2de95ab
@@ -216,7 +216,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
val receiverTypeCandidate: TypeCandidate?
val mandatoryTypeParametersAsCandidates: List<TypeCandidate>
val substitutions: List<JetTypeSubstitution>
var released: Boolean = false
var finished: Boolean = false
init {
// gather relevant information
@@ -1041,7 +1041,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
}
}
finally {
release()
finished = true
onFinish()
}
}
@@ -1057,18 +1057,10 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
}
fun showDialogIfNeeded() {
if (!ApplicationManager.getApplication().isUnitTestMode() && dialogWithEditor != null && !released) {
if (!ApplicationManager.getApplication().isUnitTestMode() && dialogWithEditor != null && !finished) {
dialogWithEditor.show()
}
}
private fun release() {
if (released) return
dialogWithEditor?.let {
jetFileToEdit.delete()
released = true
}
}
}
}