mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
committed by
intellij-monorepo-bot
parent
f2b1839a7d
commit
b449bf3d72
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
+3
-3
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user