Do not log ProcessCanceledException in copy paste reference processor
It is rethrown and leads to inability to copy code #KT-5426
This commit is contained in:
@@ -63,6 +63,7 @@ import org.jetbrains.jet.lang.psi.psiUtil.getReceiverExpression
|
||||
import org.jetbrains.jet.utils.*
|
||||
import org.jetbrains.jet.renderer.DescriptorRenderer
|
||||
import org.jetbrains.jet.lang.resolve.descriptorUtil.isExtension
|
||||
import com.intellij.openapi.progress.ProcessCanceledException
|
||||
|
||||
//NOTE: this class is based on CopyPasteReferenceProcessor and JavaCopyPasteReferenceProcessor
|
||||
public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<ReferenceTransferableData>() {
|
||||
@@ -106,6 +107,12 @@ public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<Refere
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e: ProcessCanceledException) {
|
||||
// supposedly session can only be canceled from another thread
|
||||
// do not log ProcessCanceledException as it is rethrown by IdeaLogger and code won't be copied
|
||||
LOG.error("ProcessCanceledException while analyzing references in ${file.getName()}. References can't be processed.")
|
||||
return listOf()
|
||||
}
|
||||
catch (e: Throwable) {
|
||||
LOG.error("Exception in processing references for copy paste in file ${file.getName()}}", e)
|
||||
return listOf()
|
||||
|
||||
Reference in New Issue
Block a user