IDEA-CR-55846 UX-931 intentions preview: accident merge error

GitOrigin-RevId: 2cd946552202a5b886f96d60f9e6eb336badc9f2
This commit is contained in:
Dmitry.Krasilschikov
2019-12-03 16:04:11 +00:00
committed by intellij-monorepo-bot
parent ccb1699fba
commit 45dc0939a0
5 changed files with 15 additions and 19 deletions
@@ -329,7 +329,7 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass {
}
}
~ if (indicator != null) {
if (indicator != null) {
indicator.setText("Searching for additional intention actions & quick fixes");
}
for (IntentionMenuContributor extension : IntentionMenuContributor.EP_NAME.getExtensionList()) {
@@ -76,7 +76,6 @@ public class IntentionListStep implements ListPopupStep<IntentionActionWithTextC
}
if (hasSubstep(action)) {
//close intention preview popup if any
closeIntentionPreviewPopup();
return getSubStep(action, action.getToolName());
@@ -19,7 +19,6 @@ import com.intellij.psi.PsiFile
import com.intellij.psi.PsiFileFactory
import java.util.concurrent.Callable
internal class IntentionPreviewComputable(private val project: Project,
private val action: IntentionAction,
private val originalFile: PsiFile,
@@ -52,11 +51,14 @@ internal class IntentionPreviewComputable(private val project: Project,
)
}
catch (e: IntentionPreviewUnsupportedOperationException) {
throw ProcessCanceledException()
return null
}
catch (e: ProcessCanceledException) {
throw e
}
catch (e: Exception) {
LOG.debug("There are exceptions on invocation the intention: '${action.text}' on a copy of the file.", e)
throw ProcessCanceledException(e)
return null
}
}
@@ -89,4 +91,4 @@ internal class IntentionPreviewComputable(private val project: Project,
}
}
data class IntentionPreviewResult(val psiFile: PsiFile?, val lineFragments: List<LineFragment>)
internal data class IntentionPreviewResult(val psiFile: PsiFile?, val lineFragments: List<LineFragment>)
@@ -22,7 +22,7 @@ internal class IntentionPreviewEditorsPanel(val editors: List<EditorEx>) : JPane
private fun createSeparatorLine(colorsScheme: EditorColorsScheme): JPanel {
var color = colorsScheme.getColor(CodeInsightColors.METHOD_SEPARATORS_COLOR)
color = color?.let { JBColor.namedColor("Group.separatorColor", JBColor(Gray.xCD, Gray.x51)) }
color = color ?: JBColor.namedColor("Group.separatorColor", JBColor(Gray.xCD, Gray.x51))
return JBUI.Panels.simplePanel().withBorder(JBUI.Borders.customLine(color, 1, 0, 0, 0))
}
@@ -72,19 +72,14 @@ internal class IntentionPreviewPopupUpdateProcessor(private val project: Project
}
private fun renderPreview(result: IntentionPreviewResult?) {
try {
val editors = IntentionPreviewModel.createEditors(project, originalFile, result)
if (editors.isEmpty()) {
select(NO_PREVIEW)
return
}
editorsToRelease.addAll(editors)
select(index, editors)
}
catch (e: Exception) {
val editors = IntentionPreviewModel.createEditors(project, originalFile, result)
if (editors.isEmpty()) {
select(NO_PREVIEW)
return
}
editorsToRelease.addAll(editors)
select(index, editors)
}
fun setup(updateAdvertiser: (String) -> Unit, parentIndex: Int) {
@@ -118,5 +113,5 @@ internal class IntentionPreviewPopupUpdateProcessor(private val project: Project
private val ESCAPE_SHORTCUT_TEXT = KeymapUtil.getPreferredShortcutText(ESCAPE.shortcuts)
}
class IntentionPreviewPopupKey
internal class IntentionPreviewPopupKey
}