mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs] IJPL-173924 Cleanup refresh methods in ChangesViewEx
GitOrigin-RevId: 07f6b7d1f0bd2e6cf47b857287fc614d37d50dd5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
55018c676b
commit
a21e674a8a
@@ -775,9 +775,8 @@ com.intellij.openapi.vcs.changes.ChangesViewEx
|
||||
- com.intellij.openapi.vcs.changes.ChangesViewI
|
||||
- a:getCommitWorkflowHandler():com.intellij.vcs.commit.ChangesViewCommitWorkflowHandler
|
||||
- a:isAllowExcludeFromCommit():Z
|
||||
- a:refresh(java.lang.Runnable):V
|
||||
- refresh(kotlin.coroutines.Continuation):java.lang.Object
|
||||
- a:resetViewImmediatelyAndRefreshLater():V
|
||||
- a:scheduleRefresh(java.lang.Runnable):V
|
||||
com.intellij.openapi.vcs.changes.ChangesViewI
|
||||
- a:scheduleRefresh():V
|
||||
- a:selectChanges(java.util.List):V
|
||||
@@ -798,9 +797,9 @@ c:com.intellij.openapi.vcs.changes.ChangesViewManager
|
||||
- s:getLocalChangesToolWindowName(com.intellij.openapi.project.Project):java.lang.String
|
||||
- isAllowExcludeFromCommit():Z
|
||||
- isDiffPreviewAvailable():Z
|
||||
- refresh(java.lang.Runnable):V
|
||||
- resetViewImmediatelyAndRefreshLater():V
|
||||
- scheduleRefresh():V
|
||||
- scheduleRefresh(java.lang.Runnable):V
|
||||
- selectChanges(java.util.List):V
|
||||
- selectFile(com.intellij.openapi.vfs.VirtualFile):V
|
||||
- setBusy(Z):V
|
||||
|
||||
@@ -4,7 +4,6 @@ package com.intellij.openapi.vcs.changes
|
||||
import com.intellij.util.concurrency.annotations.RequiresBackgroundThread
|
||||
import com.intellij.util.concurrency.annotations.RequiresEdt
|
||||
import com.intellij.vcs.commit.ChangesViewCommitWorkflowHandler
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import org.jetbrains.annotations.CalledInAny
|
||||
|
||||
interface ChangesViewEx : ChangesViewI {
|
||||
@@ -15,13 +14,7 @@ interface ChangesViewEx : ChangesViewI {
|
||||
fun resetViewImmediatelyAndRefreshLater()
|
||||
|
||||
@CalledInAny
|
||||
fun refresh(@RequiresBackgroundThread callback: Runnable?)
|
||||
|
||||
suspend fun refresh() {
|
||||
val deferred = CompletableDeferred<Unit>()
|
||||
refresh { deferred.complete(Unit) }
|
||||
deferred.await()
|
||||
}
|
||||
fun scheduleRefresh(@RequiresBackgroundThread callback: Runnable)
|
||||
|
||||
val isAllowExcludeFromCommit: Boolean
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ public class ChangesViewManager implements ChangesViewEx, Disposable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh(@Nullable Runnable callback) {
|
||||
public void scheduleRefresh(@NotNull Runnable callback) {
|
||||
if (myToolWindowPanel != null) {
|
||||
myToolWindowPanel.scheduleRefreshNow(callback);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class DummyChangesView implements ChangesViewEx {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh(@Nullable Runnable callback) {
|
||||
public void scheduleRefresh(@NotNull Runnable callback) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension
|
||||
// this trick is essential since we are under some conditions to refresh changes;
|
||||
// but we can only rely on callback after refresh
|
||||
ChangeListManager.getInstance(project).invokeAfterUpdate(true, () -> {
|
||||
ChangesViewManager.getInstanceEx(project).refresh(() -> {
|
||||
ChangesViewManager.getInstanceEx(project).scheduleRefresh(() -> {
|
||||
try {
|
||||
List<? extends Change> actualChanges = loadFakeRevisions(project, changes);
|
||||
resultRef.complete(collectRequestProducers(project, actualChanges, unversioned, view));
|
||||
|
||||
@@ -63,7 +63,7 @@ abstract class ChangeListViewCommitPanel @ApiStatus.Internal constructor(
|
||||
}
|
||||
|
||||
final override var editedCommit: EditedCommitPresentation? by observable(null) { _, _, newValue ->
|
||||
ChangesViewManager.getInstanceEx(project).refresh {
|
||||
ChangesViewManager.getInstanceEx(project).scheduleRefresh {
|
||||
application.invokeLater { newValue?.let { expand(it) } }
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ abstract class ChangeListViewCommitPanel @ApiStatus.Internal constructor(
|
||||
|
||||
private fun closeEditorPreviewIfEmpty() {
|
||||
val changesViewManager = ChangesViewManager.getInstance(project) as? ChangesViewManager ?: return
|
||||
ChangesViewManager.getInstanceEx(project).refresh {
|
||||
ChangesViewManager.getInstanceEx(project).scheduleRefresh {
|
||||
application.invokeLater {
|
||||
changesViewManager.closeEditorPreview(true)
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager.Companion.g
|
||||
import com.intellij.openapi.vcs.changes.ui.ChangesViewContentManagerListener
|
||||
import com.intellij.openapi.vcs.changes.ui.isCommitToolWindowShown
|
||||
import com.intellij.openapi.wm.ToolWindow
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
class ChangesViewCommitPanel @ApiStatus.Internal constructor(
|
||||
@@ -68,7 +69,9 @@ class ChangesViewCommitPanel @ApiStatus.Internal constructor(
|
||||
private fun getVcsToolWindow(): ToolWindow? = getToolWindowFor(project, LOCAL_CHANGES)
|
||||
|
||||
override suspend fun refreshChangesViewBeforeCommit() {
|
||||
ChangesViewManager.getInstanceEx(project).refresh()
|
||||
val deferred = CompletableDeferred<Unit>()
|
||||
ChangesViewManager.getInstanceEx(project).scheduleRefresh { deferred.complete(Unit) }
|
||||
deferred.await()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user