mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-CR-55846 UX-931 intentions preview: accident merge error
GitOrigin-RevId: 2cd946552202a5b886f96d60f9e6eb336badc9f2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ccb1699fba
commit
45dc0939a0
@@ -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());
|
||||
|
||||
+6
-4
@@ -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>)
|
||||
+1
-1
@@ -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))
|
||||
}
|
||||
|
||||
+7
-12
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user