IDEA-215976 IDEA 192.5118.1 hangs after start on macOs

setPath is called now in a more appropriate time, and no any additional wrapper around VFS refresh is required now

`isRefreshVfs`

GitOrigin-RevId: 76e14c26a94ed7e82e5845b29112a0eee60817b5
This commit is contained in:
Vladimir Krivosheev
2019-06-11 18:11:42 +03:00
committed by intellij-monorepo-bot
parent f2b1839a7d
commit b449bf3d72
4 changed files with 10 additions and 18 deletions
@@ -105,8 +105,7 @@ abstract class ProjectStoreBase(final override val project: Project) : Component
}
}
// used in upsource
protected suspend fun setPath(filePath: String, isRefreshVfs: Boolean) {
override fun setPath(filePath: String, isRefreshVfsNeeded: Boolean) {
val storageManager = storageManager
val fs = LocalFileSystem.getInstance()
val isUnitTestMode = ApplicationManager.getApplication().isUnitTestMode
@@ -118,10 +117,8 @@ abstract class ProjectStoreBase(final override val project: Project) : Component
val workspacePath = composeFileBasedProjectWorkSpacePath(filePath)
storageManager.addMacro(StoragePathMacros.WORKSPACE_FILE, workspacePath)
if (isRefreshVfs) {
withEdtContext {
VfsUtil.markDirtyAndRefresh(false, true, false, fs.refreshAndFindFileByPath(filePath), fs.refreshAndFindFileByPath(workspacePath))
}
if (isRefreshVfsNeeded) {
VfsUtil.markDirtyAndRefresh(false, true, false, fs.refreshAndFindFileByPath(filePath), fs.refreshAndFindFileByPath(workspacePath))
}
if (isUnitTestMode) {
@@ -142,10 +139,8 @@ abstract class ProjectStoreBase(final override val project: Project) : Component
isOptimiseTestLoadSpeed = !Paths.get(filePath).exists()
}
if (isRefreshVfs) {
withEdtContext {
VfsUtil.markDirtyAndRefresh(false, true, true, fs.refreshAndFindFileByPath(configDir))
}
if (isRefreshVfsNeeded) {
VfsUtil.markDirtyAndRefresh(false, true, true, fs.refreshAndFindFileByPath(configDir))
}
}
@@ -23,7 +23,6 @@ import com.intellij.util.containers.computeIfAny
import com.intellij.util.io.*
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.CalledInAny
import java.nio.file.AccessDeniedException
@@ -46,9 +45,7 @@ open class ProjectStoreImpl(project: Project) : ProjectStoreBase(project) {
override val storageManager = ProjectStateStorageManager(TrackingPathMacroSubstitutorImpl(PathMacroManager.getInstance(project)), project)
override fun setPath(path: String) {
runBlocking {
setPath(path, true)
}
setPath(path, true)
}
override fun getProjectName(): String {
@@ -283,7 +283,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements Disposable {
try {
project.registerComponents();
IProjectStore stateStore = project.getStateStore();
stateStore.setPath(filePath);
stateStore.setPath(filePath, true);
if (template != null) {
stateStore.loadProjectFromTemplate(template);
}
@@ -1,6 +1,4 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.components.impl.stores;
import com.intellij.openapi.components.StorageScheme;
@@ -69,4 +67,6 @@ public interface IProjectStore extends IComponentStore {
@NotNull
@SystemIndependent
String getDirectoryStorePathOrBase();
void setPath(@NotNull @SystemIndependent String path, boolean isRefreshVfsNeeded);
}