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 receiverTypeCandidate: TypeCandidate?
val mandatoryTypeParametersAsCandidates: List<TypeCandidate> val mandatoryTypeParametersAsCandidates: List<TypeCandidate>
val substitutions: List<JetTypeSubstitution> val substitutions: List<JetTypeSubstitution>
var released: Boolean = false var finished: Boolean = false
init { init {
// gather relevant information // gather relevant information
@@ -1041,7 +1041,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
} }
} }
finally { finally {
release() finished = true
onFinish() onFinish()
} }
} }
@@ -1057,18 +1057,10 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
} }
fun showDialogIfNeeded() { fun showDialogIfNeeded() {
if (!ApplicationManager.getApplication().isUnitTestMode() && dialogWithEditor != null && !released) { if (!ApplicationManager.getApplication().isUnitTestMode() && dialogWithEditor != null && !finished) {
dialogWithEditor.show() dialogWithEditor.show()
} }
} }
private fun release() {
if (released) return
dialogWithEditor?.let {
jetFileToEdit.delete()
released = true
}
}
} }
} }