void () { final List<VirtualFile> toRefreshFiles = new ArrayList<>(); final List<VirtualFile> toRefreshDirs = new ArrayList<>(); for (VirtualFile file : myFilesToRefresh) { if (file == null) continue; if (file.isDirectory()) { toRefreshDirs.add(file); } else { toRefreshFiles.add(file); } } // if refresh asynchronously, local changes would also be notified that they are dirty asynchronously, // and commit could be executed while not all changes are visible filterOutInvalid(myFilesToRefresh); RefreshQueue.getInstance().refresh(true, true, () -> { if (myVcs.getProject().isDisposed()) return; filterOutInvalid(toRefreshFiles); filterOutInvalid(toRefreshDirs); final VcsDirtyScopeManager vcsDirtyScopeManager = VcsDirtyScopeManager.getInstance(myVcs.getProject()); vcsDirtyScopeManager.filesDirty(toRefreshFiles, toRefreshDirs); }, myFilesToRefresh); myFilesToRefresh.clear(); }