IJPL-160418 Get rid of dependency on intellij.platform.ide

Having this dependency will prevent us from using `ProjectEntity` in other places in the platform (e.g. progresses), because it's causing circular dependencies.

The only reason this dependency exists is the ` whenDisposed ` utility method.
However, it can be easily replaced with `Disposer.register`

GitOrigin-RevId: e6593e03890687e16d45139ab120f38cc3ef0b9b
This commit is contained in:
Kate Botsman
2024-09-10 11:49:48 +02:00
committed by intellij-monorepo-bot
parent a606079c54
commit 71e2d81521
2 changed files with 4 additions and 4 deletions

View File

@@ -34,6 +34,5 @@
<orderEntry type="library" name="kotlinx-serialization-json" level="project" />
<orderEntry type="module" module-name="intellij.platform.kernel" />
<orderEntry type="module" module-name="intellij.platform.projectModel" />
<orderEntry type="module" module-name="intellij.platform.ide" />
</component>
</module>

View File

@@ -1,11 +1,12 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.platform.project
import com.intellij.openapi.Disposable
import com.intellij.openapi.components.service
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.observable.util.whenDisposed
import com.intellij.openapi.progress.runBlockingMaybeCancellable
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Disposer
import com.intellij.platform.kernel.withKernel
import com.jetbrains.rhizomedb.entity
import fleet.kernel.change
@@ -65,12 +66,12 @@ abstract class ProjectEntitiesStorage {
LOG.info("Entity for project $projectId created successfully")
project.whenDisposed {
Disposer.register(project, Disposable {
LOG.info("Project $projectId is disposed, removing entity")
runBlockingMaybeCancellable {
removeProjectEntity(project)
}
}
})
}
/**