mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-895 Regenerate entities in kotlin.base.scripting.k1 (review IJ-MR-195501)
(cherry picked from commit 0d1c299eb229ed65adee17992bbdcf2129c6da8d) IJ-MR-195501 (cherry picked from commit db37fd378dd7e76eee3902ca8b4390282dca5273) GitOrigin-RevId: c9518c2f0e4519ed9f0d8541b2b30628857ba851
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6266eec7ef
commit
5d5236bbf1
+28
-24
@@ -3,47 +3,51 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.core.script.k1.ucache
|
||||
|
||||
import com.intellij.platform.workspace.storage.*
|
||||
import com.intellij.platform.workspace.storage.EntitySource
|
||||
import com.intellij.platform.workspace.storage.EntityType
|
||||
import com.intellij.platform.workspace.storage.GeneratedCodeApiVersion
|
||||
import com.intellij.platform.workspace.storage.MutableEntityStorage
|
||||
import com.intellij.platform.workspace.storage.WorkspaceEntityBuilder
|
||||
import com.intellij.platform.workspace.storage.impl.containers.toMutableWorkspaceSet
|
||||
import org.jetbrains.kotlin.K1Deprecation
|
||||
|
||||
@K1Deprecation
|
||||
@GeneratedCodeApiVersion(3)
|
||||
interface KotlinScriptEntityBuilder : WorkspaceEntityBuilder<KotlinScriptEntity> {
|
||||
override var entitySource: EntitySource
|
||||
var path: String
|
||||
var dependencies: MutableSet<KotlinScriptLibraryId>
|
||||
override var entitySource: EntitySource
|
||||
var path: String
|
||||
var dependencies: MutableSet<KotlinScriptLibraryId>
|
||||
}
|
||||
|
||||
internal object KotlinScriptEntityType : EntityType<KotlinScriptEntity, KotlinScriptEntityBuilder>() {
|
||||
override val entityClass: Class<KotlinScriptEntity> get() = KotlinScriptEntity::class.java
|
||||
operator fun invoke(
|
||||
path: String,
|
||||
dependencies: Set<KotlinScriptLibraryId>,
|
||||
entitySource: EntitySource,
|
||||
init: (KotlinScriptEntityBuilder.() -> Unit)? = null,
|
||||
): KotlinScriptEntityBuilder {
|
||||
val builder = builder()
|
||||
builder.path = path
|
||||
builder.dependencies = dependencies.toMutableWorkspaceSet()
|
||||
builder.entitySource = entitySource
|
||||
init?.invoke(builder)
|
||||
return builder
|
||||
}
|
||||
override val entityClass: Class<KotlinScriptEntity> get() = KotlinScriptEntity::class.java
|
||||
operator fun invoke(
|
||||
path: String,
|
||||
dependencies: Set<KotlinScriptLibraryId>,
|
||||
entitySource: EntitySource,
|
||||
init: (KotlinScriptEntityBuilder.() -> Unit)? = null,
|
||||
): KotlinScriptEntityBuilder {
|
||||
val builder = builder()
|
||||
builder.path = path
|
||||
builder.dependencies = dependencies.toMutableWorkspaceSet()
|
||||
builder.entitySource = entitySource
|
||||
init?.invoke(builder)
|
||||
return builder
|
||||
}
|
||||
}
|
||||
|
||||
@K1Deprecation
|
||||
fun MutableEntityStorage.modifyKotlinScriptEntity(
|
||||
entity: KotlinScriptEntity,
|
||||
modification: KotlinScriptEntityBuilder.() -> Unit,
|
||||
entity: KotlinScriptEntity,
|
||||
modification: KotlinScriptEntityBuilder.() -> Unit,
|
||||
): KotlinScriptEntity = modifyEntity(KotlinScriptEntityBuilder::class.java, entity, modification)
|
||||
|
||||
@K1Deprecation
|
||||
@JvmOverloads
|
||||
@JvmName("createKotlinScriptEntity")
|
||||
fun KotlinScriptEntity(
|
||||
path: String,
|
||||
dependencies: Set<KotlinScriptLibraryId>,
|
||||
entitySource: EntitySource,
|
||||
init: (KotlinScriptEntityBuilder.() -> Unit)? = null,
|
||||
path: String,
|
||||
dependencies: Set<KotlinScriptLibraryId>,
|
||||
entitySource: EntitySource,
|
||||
init: (KotlinScriptEntityBuilder.() -> Unit)? = null,
|
||||
): KotlinScriptEntityBuilder = KotlinScriptEntityType(path, dependencies, entitySource, init)
|
||||
|
||||
+40
-34
@@ -3,7 +3,11 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.core.script.k1.ucache
|
||||
|
||||
import com.intellij.platform.workspace.storage.*
|
||||
import com.intellij.platform.workspace.storage.EntitySource
|
||||
import com.intellij.platform.workspace.storage.EntityType
|
||||
import com.intellij.platform.workspace.storage.GeneratedCodeApiVersion
|
||||
import com.intellij.platform.workspace.storage.MutableEntityStorage
|
||||
import com.intellij.platform.workspace.storage.WorkspaceEntityBuilder
|
||||
import com.intellij.platform.workspace.storage.impl.containers.toMutableWorkspaceList
|
||||
import com.intellij.platform.workspace.storage.impl.containers.toMutableWorkspaceSet
|
||||
import org.jetbrains.kotlin.K1Deprecation
|
||||
@@ -11,48 +15,50 @@ import org.jetbrains.kotlin.K1Deprecation
|
||||
@K1Deprecation
|
||||
@GeneratedCodeApiVersion(3)
|
||||
interface KotlinScriptLibraryEntityBuilder : WorkspaceEntityBuilder<KotlinScriptLibraryEntity> {
|
||||
override var entitySource: EntitySource
|
||||
var name: String
|
||||
var roots: MutableList<KotlinScriptLibraryRoot>
|
||||
var indexSourceRoots: Boolean
|
||||
var usedInScripts: MutableSet<KotlinScriptId>
|
||||
override var entitySource: EntitySource
|
||||
var name: String
|
||||
var roots: MutableList<KotlinScriptLibraryRoot>
|
||||
var indexSourceRoots: Boolean
|
||||
var usedInScripts: MutableSet<KotlinScriptId>
|
||||
}
|
||||
|
||||
internal object KotlinScriptLibraryEntityType : EntityType<KotlinScriptLibraryEntity, KotlinScriptLibraryEntityBuilder>() {
|
||||
override val entityClass: Class<KotlinScriptLibraryEntity> get() = KotlinScriptLibraryEntity::class.java
|
||||
operator fun invoke(
|
||||
name: String,
|
||||
roots: List<KotlinScriptLibraryRoot>,
|
||||
indexSourceRoots: Boolean,
|
||||
usedInScripts: Set<KotlinScriptId>,
|
||||
entitySource: EntitySource,
|
||||
init: (KotlinScriptLibraryEntityBuilder.() -> Unit)? = null,
|
||||
): KotlinScriptLibraryEntityBuilder {
|
||||
val builder = builder()
|
||||
builder.name = name
|
||||
builder.roots = roots.toMutableWorkspaceList()
|
||||
builder.indexSourceRoots = indexSourceRoots
|
||||
builder.usedInScripts = usedInScripts.toMutableWorkspaceSet()
|
||||
builder.entitySource = entitySource
|
||||
init?.invoke(builder)
|
||||
return builder
|
||||
}
|
||||
internal object KotlinScriptLibraryEntityType :
|
||||
EntityType<KotlinScriptLibraryEntity, KotlinScriptLibraryEntityBuilder>() {
|
||||
override val entityClass: Class<KotlinScriptLibraryEntity> get() = KotlinScriptLibraryEntity::class.java
|
||||
operator fun invoke(
|
||||
name: String,
|
||||
roots: List<KotlinScriptLibraryRoot>,
|
||||
indexSourceRoots: Boolean,
|
||||
usedInScripts: Set<KotlinScriptId>,
|
||||
entitySource: EntitySource,
|
||||
init: (KotlinScriptLibraryEntityBuilder.() -> Unit)? = null,
|
||||
): KotlinScriptLibraryEntityBuilder {
|
||||
val builder = builder()
|
||||
builder.name = name
|
||||
builder.roots = roots.toMutableWorkspaceList()
|
||||
builder.indexSourceRoots = indexSourceRoots
|
||||
builder.usedInScripts = usedInScripts.toMutableWorkspaceSet()
|
||||
builder.entitySource = entitySource
|
||||
init?.invoke(builder)
|
||||
return builder
|
||||
}
|
||||
}
|
||||
|
||||
@K1Deprecation
|
||||
fun MutableEntityStorage.modifyKotlinScriptLibraryEntity(
|
||||
entity: KotlinScriptLibraryEntity,
|
||||
modification: KotlinScriptLibraryEntityBuilder.() -> Unit,
|
||||
entity: KotlinScriptLibraryEntity,
|
||||
modification: KotlinScriptLibraryEntityBuilder.() -> Unit,
|
||||
): KotlinScriptLibraryEntity = modifyEntity(KotlinScriptLibraryEntityBuilder::class.java, entity, modification)
|
||||
|
||||
@K1Deprecation
|
||||
@JvmOverloads
|
||||
@JvmName("createKotlinScriptLibraryEntity")
|
||||
fun KotlinScriptLibraryEntity(
|
||||
name: String,
|
||||
roots: List<KotlinScriptLibraryRoot>,
|
||||
indexSourceRoots: Boolean,
|
||||
usedInScripts: Set<KotlinScriptId>,
|
||||
entitySource: EntitySource,
|
||||
init: (KotlinScriptLibraryEntityBuilder.() -> Unit)? = null,
|
||||
): KotlinScriptLibraryEntityBuilder = KotlinScriptLibraryEntityType(name, roots, indexSourceRoots, usedInScripts, entitySource, init)
|
||||
name: String,
|
||||
roots: List<KotlinScriptLibraryRoot>,
|
||||
indexSourceRoots: Boolean,
|
||||
usedInScripts: Set<KotlinScriptId>,
|
||||
entitySource: EntitySource,
|
||||
init: (KotlinScriptLibraryEntityBuilder.() -> Unit)? = null,
|
||||
): KotlinScriptLibraryEntityBuilder =
|
||||
KotlinScriptLibraryEntityType(name, roots, indexSourceRoots, usedInScripts, entitySource, init)
|
||||
|
||||
+227
-223
@@ -1,7 +1,15 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.kotlin.idea.core.script.k1.ucache.impl
|
||||
|
||||
import com.intellij.platform.workspace.storage.*
|
||||
import com.intellij.platform.workspace.storage.ConnectionId
|
||||
import com.intellij.platform.workspace.storage.EntitySource
|
||||
import com.intellij.platform.workspace.storage.GeneratedCodeApiVersion
|
||||
import com.intellij.platform.workspace.storage.GeneratedCodeImplVersion
|
||||
import com.intellij.platform.workspace.storage.MutableEntityStorage
|
||||
import com.intellij.platform.workspace.storage.SymbolicEntityId
|
||||
import com.intellij.platform.workspace.storage.WorkspaceEntity
|
||||
import com.intellij.platform.workspace.storage.WorkspaceEntityBuilder
|
||||
import com.intellij.platform.workspace.storage.WorkspaceEntityInternalApi
|
||||
import com.intellij.platform.workspace.storage.impl.ModifiableWorkspaceEntityBase
|
||||
import com.intellij.platform.workspace.storage.impl.SoftLinkable
|
||||
import com.intellij.platform.workspace.storage.impl.WorkspaceEntityBase
|
||||
@@ -21,270 +29,266 @@ import org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryId
|
||||
@GeneratedCodeImplVersion(7)
|
||||
@OptIn(WorkspaceEntityInternalApi::class)
|
||||
internal class KotlinScriptEntityImpl(private val dataSource: KotlinScriptEntityData) : KotlinScriptEntity,
|
||||
WorkspaceEntityBase(dataSource) {
|
||||
WorkspaceEntityBase(dataSource) {
|
||||
|
||||
private companion object {
|
||||
private companion object {
|
||||
|
||||
private val connections = listOf<ConnectionId>()
|
||||
private val connections = listOf<ConnectionId>()
|
||||
|
||||
}
|
||||
|
||||
override val symbolicId: KotlinScriptId = super.symbolicId
|
||||
|
||||
override val path: String
|
||||
get() {
|
||||
readField("path")
|
||||
return dataSource.path
|
||||
}
|
||||
override val dependencies: Set<KotlinScriptLibraryId>
|
||||
get() {
|
||||
readField("dependencies")
|
||||
return dataSource.dependencies
|
||||
}
|
||||
|
||||
override val entitySource: EntitySource
|
||||
get() {
|
||||
readField("entitySource")
|
||||
return dataSource.entitySource
|
||||
}
|
||||
override val symbolicId: KotlinScriptId = super.symbolicId
|
||||
|
||||
override fun connectionIdList(): List<ConnectionId> {
|
||||
return connections
|
||||
}
|
||||
|
||||
|
||||
internal class Builder(result: KotlinScriptEntityData?) :
|
||||
ModifiableWorkspaceEntityBase<KotlinScriptEntity, KotlinScriptEntityData>(result), KotlinScriptEntityBuilder {
|
||||
internal constructor() : this(KotlinScriptEntityData())
|
||||
|
||||
override fun applyToBuilder(builder: MutableEntityStorage) {
|
||||
if (this.diff != null) {
|
||||
if (existsInBuilder(builder)) {
|
||||
this.diff = builder
|
||||
return
|
||||
override val path: String
|
||||
get() {
|
||||
readField("path")
|
||||
return dataSource.path
|
||||
}
|
||||
else {
|
||||
error("Entity KotlinScriptEntity is already created in a different builder")
|
||||
override val dependencies: Set<KotlinScriptLibraryId>
|
||||
get() {
|
||||
readField("dependencies")
|
||||
return dataSource.dependencies
|
||||
}
|
||||
}
|
||||
this.diff = builder
|
||||
addToBuilder()
|
||||
this.id = getEntityData().createEntityId()
|
||||
// After adding entity data to the builder, we need to unbind it and move the control over entity data to builder
|
||||
// Builder may switch to snapshot at any moment and lock entity data to modification
|
||||
this.currentEntityData = null
|
||||
// Process linked entities that are connected without a builder
|
||||
processLinkedEntities(builder)
|
||||
checkInitialization() // TODO uncomment and check failed tests
|
||||
}
|
||||
|
||||
private fun checkInitialization() {
|
||||
val _diff = diff
|
||||
if (!getEntityData().isEntitySourceInitialized()) {
|
||||
error("Field WorkspaceEntity#entitySource should be initialized")
|
||||
}
|
||||
if (!getEntityData().isPathInitialized()) {
|
||||
error("Field KotlinScriptEntity#path should be initialized")
|
||||
}
|
||||
if (!getEntityData().isDependenciesInitialized()) {
|
||||
error("Field KotlinScriptEntity#dependencies should be initialized")
|
||||
}
|
||||
}
|
||||
override val entitySource: EntitySource
|
||||
get() {
|
||||
readField("entitySource")
|
||||
return dataSource.entitySource
|
||||
}
|
||||
|
||||
override fun connectionIdList(): List<ConnectionId> {
|
||||
return connections
|
||||
}
|
||||
|
||||
override fun afterModification() {
|
||||
val collection_dependencies = getEntityData().dependencies
|
||||
if (collection_dependencies is MutableWorkspaceSet<*>) {
|
||||
collection_dependencies.cleanModificationUpdateAction()
|
||||
}
|
||||
}
|
||||
|
||||
// Relabeling code, move information from dataSource to this builder
|
||||
override fun relabel(dataSource: WorkspaceEntity, parents: Set<WorkspaceEntity>?) {
|
||||
dataSource as KotlinScriptEntity
|
||||
if (this.entitySource != dataSource.entitySource) this.entitySource = dataSource.entitySource
|
||||
if (this.path != dataSource.path) this.path = dataSource.path
|
||||
if (this.dependencies != dataSource.dependencies) this.dependencies = dataSource.dependencies.toMutableSet()
|
||||
updateChildToParentReferences(parents)
|
||||
return connections
|
||||
}
|
||||
|
||||
|
||||
override var entitySource: EntitySource
|
||||
get() = getEntityData().entitySource
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).entitySource = value
|
||||
changedProperty.add("entitySource")
|
||||
internal class Builder(result: KotlinScriptEntityData?) :
|
||||
ModifiableWorkspaceEntityBase<KotlinScriptEntity, KotlinScriptEntityData>(result), KotlinScriptEntityBuilder {
|
||||
internal constructor() : this(KotlinScriptEntityData())
|
||||
|
||||
}
|
||||
override var path: String
|
||||
get() = getEntityData().path
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).path = value
|
||||
changedProperty.add("path")
|
||||
}
|
||||
private val dependenciesUpdater: (value: Set<KotlinScriptLibraryId>) -> Unit = { value ->
|
||||
|
||||
changedProperty.add("dependencies")
|
||||
}
|
||||
override var dependencies: MutableSet<KotlinScriptLibraryId>
|
||||
get() {
|
||||
val collection_dependencies = getEntityData().dependencies
|
||||
if (collection_dependencies !is MutableWorkspaceSet) return collection_dependencies
|
||||
if (diff == null || modifiable.get()) {
|
||||
collection_dependencies.setModificationUpdateAction(dependenciesUpdater)
|
||||
override fun applyToBuilder(builder: MutableEntityStorage) {
|
||||
if (this.diff != null) {
|
||||
if (existsInBuilder(builder)) {
|
||||
this.diff = builder
|
||||
return
|
||||
} else {
|
||||
error("Entity KotlinScriptEntity is already created in a different builder")
|
||||
}
|
||||
}
|
||||
this.diff = builder
|
||||
addToBuilder()
|
||||
this.id = getEntityData().createEntityId()
|
||||
// After adding entity data to the builder, we need to unbind it and move the control over entity data to builder
|
||||
// Builder may switch to snapshot at any moment and lock entity data to modification
|
||||
this.currentEntityData = null
|
||||
// Process linked entities that are connected without a builder
|
||||
processLinkedEntities(builder)
|
||||
checkInitialization() // TODO uncomment and check failed tests
|
||||
}
|
||||
else {
|
||||
collection_dependencies.cleanModificationUpdateAction()
|
||||
}
|
||||
return collection_dependencies
|
||||
}
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).dependencies = value
|
||||
dependenciesUpdater.invoke(value)
|
||||
}
|
||||
|
||||
override fun getEntityClass(): Class<KotlinScriptEntity> = KotlinScriptEntity::class.java
|
||||
}
|
||||
private fun checkInitialization() {
|
||||
val _diff = diff
|
||||
if (!getEntityData().isEntitySourceInitialized()) {
|
||||
error("Field WorkspaceEntity#entitySource should be initialized")
|
||||
}
|
||||
if (!getEntityData().isPathInitialized()) {
|
||||
error("Field KotlinScriptEntity#path should be initialized")
|
||||
}
|
||||
if (!getEntityData().isDependenciesInitialized()) {
|
||||
error("Field KotlinScriptEntity#dependencies should be initialized")
|
||||
}
|
||||
}
|
||||
|
||||
override fun connectionIdList(): List<ConnectionId> {
|
||||
return connections
|
||||
}
|
||||
|
||||
override fun afterModification() {
|
||||
val collection_dependencies = getEntityData().dependencies
|
||||
if (collection_dependencies is MutableWorkspaceSet<*>) {
|
||||
collection_dependencies.cleanModificationUpdateAction()
|
||||
}
|
||||
}
|
||||
|
||||
// Relabeling code, move information from dataSource to this builder
|
||||
override fun relabel(dataSource: WorkspaceEntity, parents: Set<WorkspaceEntity>?) {
|
||||
dataSource as KotlinScriptEntity
|
||||
if (this.entitySource != dataSource.entitySource) this.entitySource = dataSource.entitySource
|
||||
if (this.path != dataSource.path) this.path = dataSource.path
|
||||
if (this.dependencies != dataSource.dependencies) this.dependencies = dataSource.dependencies.toMutableSet()
|
||||
updateChildToParentReferences(parents)
|
||||
}
|
||||
|
||||
|
||||
override var entitySource: EntitySource
|
||||
get() = getEntityData().entitySource
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).entitySource = value
|
||||
changedProperty.add("entitySource")
|
||||
|
||||
}
|
||||
override var path: String
|
||||
get() = getEntityData().path
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).path = value
|
||||
changedProperty.add("path")
|
||||
}
|
||||
private val dependenciesUpdater: (value: Set<KotlinScriptLibraryId>) -> Unit = { value ->
|
||||
|
||||
changedProperty.add("dependencies")
|
||||
}
|
||||
override var dependencies: MutableSet<KotlinScriptLibraryId>
|
||||
get() {
|
||||
val collection_dependencies = getEntityData().dependencies
|
||||
if (collection_dependencies !is MutableWorkspaceSet) return collection_dependencies
|
||||
if (diff == null || modifiable.get()) {
|
||||
collection_dependencies.setModificationUpdateAction(dependenciesUpdater)
|
||||
} else {
|
||||
collection_dependencies.cleanModificationUpdateAction()
|
||||
}
|
||||
return collection_dependencies
|
||||
}
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).dependencies = value
|
||||
dependenciesUpdater.invoke(value)
|
||||
}
|
||||
|
||||
override fun getEntityClass(): Class<KotlinScriptEntity> = KotlinScriptEntity::class.java
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@OptIn(WorkspaceEntityInternalApi::class)
|
||||
internal class KotlinScriptEntityData : WorkspaceEntityData<KotlinScriptEntity>(), SoftLinkable {
|
||||
lateinit var path: String
|
||||
lateinit var dependencies: MutableSet<KotlinScriptLibraryId>
|
||||
lateinit var path: String
|
||||
lateinit var dependencies: MutableSet<KotlinScriptLibraryId>
|
||||
|
||||
internal fun isPathInitialized(): Boolean = ::path.isInitialized
|
||||
internal fun isDependenciesInitialized(): Boolean = ::dependencies.isInitialized
|
||||
internal fun isPathInitialized(): Boolean = ::path.isInitialized
|
||||
internal fun isDependenciesInitialized(): Boolean = ::dependencies.isInitialized
|
||||
|
||||
override fun getLinks(): Set<SymbolicEntityId<*>> {
|
||||
val result = HashSet<SymbolicEntityId<*>>()
|
||||
for (item in dependencies) {
|
||||
result.add(item)
|
||||
override fun getLinks(): Set<SymbolicEntityId<*>> {
|
||||
val result = HashSet<SymbolicEntityId<*>>()
|
||||
for (item in dependencies) {
|
||||
result.add(item)
|
||||
}
|
||||
return result
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
override fun index(index: WorkspaceMutableIndex<SymbolicEntityId<*>>) {
|
||||
for (item in dependencies) {
|
||||
index.index(this, item)
|
||||
override fun index(index: WorkspaceMutableIndex<SymbolicEntityId<*>>) {
|
||||
for (item in dependencies) {
|
||||
index.index(this, item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateLinksIndex(prev: Set<SymbolicEntityId<*>>, index: WorkspaceMutableIndex<SymbolicEntityId<*>>) {
|
||||
override fun updateLinksIndex(prev: Set<SymbolicEntityId<*>>, index: WorkspaceMutableIndex<SymbolicEntityId<*>>) {
|
||||
// TODO verify logic
|
||||
val mutablePreviousSet = HashSet(prev)
|
||||
for (item in dependencies) {
|
||||
val removedItem_item = mutablePreviousSet.remove(item)
|
||||
if (!removedItem_item) {
|
||||
index.index(this, item)
|
||||
}
|
||||
val mutablePreviousSet = HashSet(prev)
|
||||
for (item in dependencies) {
|
||||
val removedItem_item = mutablePreviousSet.remove(item)
|
||||
if (!removedItem_item) {
|
||||
index.index(this, item)
|
||||
}
|
||||
}
|
||||
for (removed in mutablePreviousSet) {
|
||||
index.remove(this, removed)
|
||||
}
|
||||
}
|
||||
for (removed in mutablePreviousSet) {
|
||||
index.remove(this, removed)
|
||||
|
||||
override fun updateLink(oldLink: SymbolicEntityId<*>, newLink: SymbolicEntityId<*>): Boolean {
|
||||
var changed = false
|
||||
val dependencies_data = dependencies.map {
|
||||
val it_data = if (it == oldLink) {
|
||||
changed = true
|
||||
newLink as KotlinScriptLibraryId
|
||||
} else {
|
||||
null
|
||||
}
|
||||
if (it_data != null) {
|
||||
it_data
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}
|
||||
if (dependencies_data != null) {
|
||||
dependencies = dependencies_data as MutableSet<KotlinScriptLibraryId>
|
||||
}
|
||||
return changed
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateLink(oldLink: SymbolicEntityId<*>, newLink: SymbolicEntityId<*>): Boolean {
|
||||
var changed = false
|
||||
val dependencies_data = dependencies.map {
|
||||
val it_data = if (it == oldLink) {
|
||||
changed = true
|
||||
newLink as KotlinScriptLibraryId
|
||||
}
|
||||
else {
|
||||
null
|
||||
}
|
||||
if (it_data != null) {
|
||||
it_data
|
||||
}
|
||||
else {
|
||||
it
|
||||
}
|
||||
override fun wrapAsModifiable(diff: MutableEntityStorage): WorkspaceEntityBuilder<KotlinScriptEntity> {
|
||||
val modifiable = KotlinScriptEntityImpl.Builder(null)
|
||||
modifiable.diff = diff
|
||||
modifiable.id = createEntityId()
|
||||
return modifiable
|
||||
}
|
||||
if (dependencies_data != null) {
|
||||
dependencies = dependencies_data as MutableSet<KotlinScriptLibraryId>
|
||||
|
||||
@OptIn(EntityStorageInstrumentationApi::class)
|
||||
override fun createEntity(snapshot: EntityStorageInstrumentation): KotlinScriptEntity {
|
||||
val entityId = createEntityId()
|
||||
return snapshot.initializeEntity(entityId) {
|
||||
val entity = KotlinScriptEntityImpl(this)
|
||||
entity.snapshot = snapshot
|
||||
entity.id = entityId
|
||||
entity
|
||||
}
|
||||
}
|
||||
return changed
|
||||
}
|
||||
|
||||
override fun wrapAsModifiable(diff: MutableEntityStorage): WorkspaceEntityBuilder<KotlinScriptEntity> {
|
||||
val modifiable = KotlinScriptEntityImpl.Builder(null)
|
||||
modifiable.diff = diff
|
||||
modifiable.id = createEntityId()
|
||||
return modifiable
|
||||
}
|
||||
|
||||
@OptIn(EntityStorageInstrumentationApi::class)
|
||||
override fun createEntity(snapshot: EntityStorageInstrumentation): KotlinScriptEntity {
|
||||
val entityId = createEntityId()
|
||||
return snapshot.initializeEntity(entityId) {
|
||||
val entity = KotlinScriptEntityImpl(this)
|
||||
entity.snapshot = snapshot
|
||||
entity.id = entityId
|
||||
entity
|
||||
override fun getMetadata(): EntityMetadata {
|
||||
return MetadataStorageImpl.getMetadataByTypeFqn("org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptEntity") as EntityMetadata
|
||||
}
|
||||
}
|
||||
|
||||
override fun getMetadata(): EntityMetadata {
|
||||
return MetadataStorageImpl.getMetadataByTypeFqn("org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptEntity") as EntityMetadata
|
||||
}
|
||||
override fun clone(): KotlinScriptEntityData {
|
||||
val clonedEntity = super.clone()
|
||||
clonedEntity as KotlinScriptEntityData
|
||||
clonedEntity.dependencies = clonedEntity.dependencies.toMutableWorkspaceSet()
|
||||
return clonedEntity
|
||||
}
|
||||
|
||||
override fun clone(): KotlinScriptEntityData {
|
||||
val clonedEntity = super.clone()
|
||||
clonedEntity as KotlinScriptEntityData
|
||||
clonedEntity.dependencies = clonedEntity.dependencies.toMutableWorkspaceSet()
|
||||
return clonedEntity
|
||||
}
|
||||
override fun getEntityInterface(): Class<out WorkspaceEntity> {
|
||||
return KotlinScriptEntity::class.java
|
||||
}
|
||||
|
||||
override fun getEntityInterface(): Class<out WorkspaceEntity> {
|
||||
return KotlinScriptEntity::class.java
|
||||
}
|
||||
override fun createDetachedEntity(parents: List<WorkspaceEntityBuilder<*>>): WorkspaceEntityBuilder<*> {
|
||||
return KotlinScriptEntity(path, dependencies, entitySource)
|
||||
}
|
||||
|
||||
override fun createDetachedEntity(parents: List<WorkspaceEntityBuilder<*>>): WorkspaceEntityBuilder<*> {
|
||||
return KotlinScriptEntity(path, dependencies, entitySource)
|
||||
}
|
||||
override fun getRequiredParents(): List<Class<out WorkspaceEntity>> {
|
||||
val res = mutableListOf<Class<out WorkspaceEntity>>()
|
||||
return res
|
||||
}
|
||||
|
||||
override fun getRequiredParents(): List<Class<out WorkspaceEntity>> {
|
||||
val res = mutableListOf<Class<out WorkspaceEntity>>()
|
||||
return res
|
||||
}
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other == null) return false
|
||||
if (this.javaClass != other.javaClass) return false
|
||||
other as KotlinScriptEntityData
|
||||
if (this.entitySource != other.entitySource) return false
|
||||
if (this.path != other.path) return false
|
||||
if (this.dependencies != other.dependencies) return false
|
||||
return true
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other == null) return false
|
||||
if (this.javaClass != other.javaClass) return false
|
||||
other as KotlinScriptEntityData
|
||||
if (this.entitySource != other.entitySource) return false
|
||||
if (this.path != other.path) return false
|
||||
if (this.dependencies != other.dependencies) return false
|
||||
return true
|
||||
}
|
||||
override fun equalsIgnoringEntitySource(other: Any?): Boolean {
|
||||
if (other == null) return false
|
||||
if (this.javaClass != other.javaClass) return false
|
||||
other as KotlinScriptEntityData
|
||||
if (this.path != other.path) return false
|
||||
if (this.dependencies != other.dependencies) return false
|
||||
return true
|
||||
}
|
||||
|
||||
override fun equalsIgnoringEntitySource(other: Any?): Boolean {
|
||||
if (other == null) return false
|
||||
if (this.javaClass != other.javaClass) return false
|
||||
other as KotlinScriptEntityData
|
||||
if (this.path != other.path) return false
|
||||
if (this.dependencies != other.dependencies) return false
|
||||
return true
|
||||
}
|
||||
override fun hashCode(): Int {
|
||||
var result = entitySource.hashCode()
|
||||
result = 31 * result + path.hashCode()
|
||||
result = 31 * result + dependencies.hashCode()
|
||||
return result
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = entitySource.hashCode()
|
||||
result = 31 * result + path.hashCode()
|
||||
result = 31 * result + dependencies.hashCode()
|
||||
return result
|
||||
}
|
||||
|
||||
override fun hashCodeIgnoringEntitySource(): Int {
|
||||
var result = javaClass.hashCode()
|
||||
result = 31 * result + path.hashCode()
|
||||
result = 31 * result + dependencies.hashCode()
|
||||
return result
|
||||
}
|
||||
override fun hashCodeIgnoringEntitySource(): Int {
|
||||
var result = javaClass.hashCode()
|
||||
result = 31 * result + path.hashCode()
|
||||
result = 31 * result + dependencies.hashCode()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
+294
-288
@@ -1,7 +1,15 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.kotlin.idea.core.script.k1.ucache.impl
|
||||
|
||||
import com.intellij.platform.workspace.storage.*
|
||||
import com.intellij.platform.workspace.storage.ConnectionId
|
||||
import com.intellij.platform.workspace.storage.EntitySource
|
||||
import com.intellij.platform.workspace.storage.GeneratedCodeApiVersion
|
||||
import com.intellij.platform.workspace.storage.GeneratedCodeImplVersion
|
||||
import com.intellij.platform.workspace.storage.MutableEntityStorage
|
||||
import com.intellij.platform.workspace.storage.SymbolicEntityId
|
||||
import com.intellij.platform.workspace.storage.WorkspaceEntity
|
||||
import com.intellij.platform.workspace.storage.WorkspaceEntityBuilder
|
||||
import com.intellij.platform.workspace.storage.WorkspaceEntityInternalApi
|
||||
import com.intellij.platform.workspace.storage.impl.ModifiableWorkspaceEntityBase
|
||||
import com.intellij.platform.workspace.storage.impl.SoftLinkable
|
||||
import com.intellij.platform.workspace.storage.impl.WorkspaceEntityBase
|
||||
@@ -23,337 +31,335 @@ import org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryRoot
|
||||
@GeneratedCodeApiVersion(3)
|
||||
@GeneratedCodeImplVersion(7)
|
||||
@OptIn(WorkspaceEntityInternalApi::class)
|
||||
internal class KotlinScriptLibraryEntityImpl(private val dataSource: KotlinScriptLibraryEntityData) : KotlinScriptLibraryEntity,
|
||||
WorkspaceEntityBase(dataSource) {
|
||||
internal class KotlinScriptLibraryEntityImpl(private val dataSource: KotlinScriptLibraryEntityData) :
|
||||
KotlinScriptLibraryEntity, WorkspaceEntityBase(dataSource) {
|
||||
|
||||
private companion object {
|
||||
private companion object {
|
||||
|
||||
private val connections = listOf<ConnectionId>()
|
||||
private val connections = listOf<ConnectionId>()
|
||||
|
||||
}
|
||||
|
||||
override val symbolicId: KotlinScriptLibraryId = super.symbolicId
|
||||
|
||||
override val name: String
|
||||
get() {
|
||||
readField("name")
|
||||
return dataSource.name
|
||||
}
|
||||
override val roots: List<KotlinScriptLibraryRoot>
|
||||
get() {
|
||||
readField("roots")
|
||||
return dataSource.roots
|
||||
}
|
||||
override val indexSourceRoots: Boolean
|
||||
get() {
|
||||
readField("indexSourceRoots")
|
||||
return dataSource.indexSourceRoots
|
||||
}
|
||||
override val usedInScripts: Set<KotlinScriptId>
|
||||
get() {
|
||||
readField("usedInScripts")
|
||||
return dataSource.usedInScripts
|
||||
}
|
||||
|
||||
override val entitySource: EntitySource
|
||||
get() {
|
||||
readField("entitySource")
|
||||
return dataSource.entitySource
|
||||
}
|
||||
override val symbolicId: KotlinScriptLibraryId = super.symbolicId
|
||||
|
||||
override fun connectionIdList(): List<ConnectionId> {
|
||||
return connections
|
||||
}
|
||||
|
||||
|
||||
internal class Builder(result: KotlinScriptLibraryEntityData?) :
|
||||
ModifiableWorkspaceEntityBase<KotlinScriptLibraryEntity, KotlinScriptLibraryEntityData>(result), KotlinScriptLibraryEntityBuilder {
|
||||
internal constructor() : this(KotlinScriptLibraryEntityData())
|
||||
|
||||
override fun applyToBuilder(builder: MutableEntityStorage) {
|
||||
if (this.diff != null) {
|
||||
if (existsInBuilder(builder)) {
|
||||
this.diff = builder
|
||||
return
|
||||
override val name: String
|
||||
get() {
|
||||
readField("name")
|
||||
return dataSource.name
|
||||
}
|
||||
else {
|
||||
error("Entity KotlinScriptLibraryEntity is already created in a different builder")
|
||||
override val roots: List<KotlinScriptLibraryRoot>
|
||||
get() {
|
||||
readField("roots")
|
||||
return dataSource.roots
|
||||
}
|
||||
override val indexSourceRoots: Boolean
|
||||
get() {
|
||||
readField("indexSourceRoots")
|
||||
return dataSource.indexSourceRoots
|
||||
}
|
||||
override val usedInScripts: Set<KotlinScriptId>
|
||||
get() {
|
||||
readField("usedInScripts")
|
||||
return dataSource.usedInScripts
|
||||
}
|
||||
}
|
||||
this.diff = builder
|
||||
addToBuilder()
|
||||
this.id = getEntityData().createEntityId()
|
||||
// After adding entity data to the builder, we need to unbind it and move the control over entity data to builder
|
||||
// Builder may switch to snapshot at any moment and lock entity data to modification
|
||||
this.currentEntityData = null
|
||||
// Process linked entities that are connected without a builder
|
||||
processLinkedEntities(builder)
|
||||
checkInitialization() // TODO uncomment and check failed tests
|
||||
}
|
||||
|
||||
private fun checkInitialization() {
|
||||
val _diff = diff
|
||||
if (!getEntityData().isEntitySourceInitialized()) {
|
||||
error("Field WorkspaceEntity#entitySource should be initialized")
|
||||
}
|
||||
if (!getEntityData().isNameInitialized()) {
|
||||
error("Field KotlinScriptLibraryEntity#name should be initialized")
|
||||
}
|
||||
if (!getEntityData().isRootsInitialized()) {
|
||||
error("Field KotlinScriptLibraryEntity#roots should be initialized")
|
||||
}
|
||||
if (!getEntityData().isUsedInScriptsInitialized()) {
|
||||
error("Field KotlinScriptLibraryEntity#usedInScripts should be initialized")
|
||||
}
|
||||
}
|
||||
override val entitySource: EntitySource
|
||||
get() {
|
||||
readField("entitySource")
|
||||
return dataSource.entitySource
|
||||
}
|
||||
|
||||
override fun connectionIdList(): List<ConnectionId> {
|
||||
return connections
|
||||
}
|
||||
|
||||
override fun afterModification() {
|
||||
val collection_roots = getEntityData().roots
|
||||
if (collection_roots is MutableWorkspaceList<*>) {
|
||||
collection_roots.cleanModificationUpdateAction()
|
||||
}
|
||||
val collection_usedInScripts = getEntityData().usedInScripts
|
||||
if (collection_usedInScripts is MutableWorkspaceSet<*>) {
|
||||
collection_usedInScripts.cleanModificationUpdateAction()
|
||||
}
|
||||
}
|
||||
|
||||
// Relabeling code, move information from dataSource to this builder
|
||||
override fun relabel(dataSource: WorkspaceEntity, parents: Set<WorkspaceEntity>?) {
|
||||
dataSource as KotlinScriptLibraryEntity
|
||||
if (this.entitySource != dataSource.entitySource) this.entitySource = dataSource.entitySource
|
||||
if (this.name != dataSource.name) this.name = dataSource.name
|
||||
if (this.roots != dataSource.roots) this.roots = dataSource.roots.toMutableList()
|
||||
if (this.indexSourceRoots != dataSource.indexSourceRoots) this.indexSourceRoots = dataSource.indexSourceRoots
|
||||
if (this.usedInScripts != dataSource.usedInScripts) this.usedInScripts = dataSource.usedInScripts.toMutableSet()
|
||||
updateChildToParentReferences(parents)
|
||||
return connections
|
||||
}
|
||||
|
||||
|
||||
override var entitySource: EntitySource
|
||||
get() = getEntityData().entitySource
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).entitySource = value
|
||||
changedProperty.add("entitySource")
|
||||
internal class Builder(result: KotlinScriptLibraryEntityData?) :
|
||||
ModifiableWorkspaceEntityBase<KotlinScriptLibraryEntity, KotlinScriptLibraryEntityData>(result),
|
||||
KotlinScriptLibraryEntityBuilder {
|
||||
internal constructor() : this(KotlinScriptLibraryEntityData())
|
||||
|
||||
}
|
||||
override var name: String
|
||||
get() = getEntityData().name
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).name = value
|
||||
changedProperty.add("name")
|
||||
}
|
||||
private val rootsUpdater: (value: List<KotlinScriptLibraryRoot>) -> Unit = { value ->
|
||||
|
||||
changedProperty.add("roots")
|
||||
}
|
||||
override var roots: MutableList<KotlinScriptLibraryRoot>
|
||||
get() {
|
||||
val collection_roots = getEntityData().roots
|
||||
if (collection_roots !is MutableWorkspaceList) return collection_roots
|
||||
if (diff == null || modifiable.get()) {
|
||||
collection_roots.setModificationUpdateAction(rootsUpdater)
|
||||
override fun applyToBuilder(builder: MutableEntityStorage) {
|
||||
if (this.diff != null) {
|
||||
if (existsInBuilder(builder)) {
|
||||
this.diff = builder
|
||||
return
|
||||
} else {
|
||||
error("Entity KotlinScriptLibraryEntity is already created in a different builder")
|
||||
}
|
||||
}
|
||||
this.diff = builder
|
||||
addToBuilder()
|
||||
this.id = getEntityData().createEntityId()
|
||||
// After adding entity data to the builder, we need to unbind it and move the control over entity data to builder
|
||||
// Builder may switch to snapshot at any moment and lock entity data to modification
|
||||
this.currentEntityData = null
|
||||
// Process linked entities that are connected without a builder
|
||||
processLinkedEntities(builder)
|
||||
checkInitialization() // TODO uncomment and check failed tests
|
||||
}
|
||||
else {
|
||||
collection_roots.cleanModificationUpdateAction()
|
||||
}
|
||||
return collection_roots
|
||||
}
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).roots = value
|
||||
rootsUpdater.invoke(value)
|
||||
}
|
||||
override var indexSourceRoots: Boolean
|
||||
get() = getEntityData().indexSourceRoots
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).indexSourceRoots = value
|
||||
changedProperty.add("indexSourceRoots")
|
||||
}
|
||||
private val usedInScriptsUpdater: (value: Set<KotlinScriptId>) -> Unit = { value ->
|
||||
|
||||
changedProperty.add("usedInScripts")
|
||||
private fun checkInitialization() {
|
||||
val _diff = diff
|
||||
if (!getEntityData().isEntitySourceInitialized()) {
|
||||
error("Field WorkspaceEntity#entitySource should be initialized")
|
||||
}
|
||||
if (!getEntityData().isNameInitialized()) {
|
||||
error("Field KotlinScriptLibraryEntity#name should be initialized")
|
||||
}
|
||||
if (!getEntityData().isRootsInitialized()) {
|
||||
error("Field KotlinScriptLibraryEntity#roots should be initialized")
|
||||
}
|
||||
if (!getEntityData().isUsedInScriptsInitialized()) {
|
||||
error("Field KotlinScriptLibraryEntity#usedInScripts should be initialized")
|
||||
}
|
||||
}
|
||||
|
||||
override fun connectionIdList(): List<ConnectionId> {
|
||||
return connections
|
||||
}
|
||||
|
||||
override fun afterModification() {
|
||||
val collection_roots = getEntityData().roots
|
||||
if (collection_roots is MutableWorkspaceList<*>) {
|
||||
collection_roots.cleanModificationUpdateAction()
|
||||
}
|
||||
val collection_usedInScripts = getEntityData().usedInScripts
|
||||
if (collection_usedInScripts is MutableWorkspaceSet<*>) {
|
||||
collection_usedInScripts.cleanModificationUpdateAction()
|
||||
}
|
||||
}
|
||||
|
||||
// Relabeling code, move information from dataSource to this builder
|
||||
override fun relabel(dataSource: WorkspaceEntity, parents: Set<WorkspaceEntity>?) {
|
||||
dataSource as KotlinScriptLibraryEntity
|
||||
if (this.entitySource != dataSource.entitySource) this.entitySource = dataSource.entitySource
|
||||
if (this.name != dataSource.name) this.name = dataSource.name
|
||||
if (this.roots != dataSource.roots) this.roots = dataSource.roots.toMutableList()
|
||||
if (this.indexSourceRoots != dataSource.indexSourceRoots) this.indexSourceRoots =
|
||||
dataSource.indexSourceRoots
|
||||
if (this.usedInScripts != dataSource.usedInScripts) this.usedInScripts =
|
||||
dataSource.usedInScripts.toMutableSet()
|
||||
updateChildToParentReferences(parents)
|
||||
}
|
||||
|
||||
|
||||
override var entitySource: EntitySource
|
||||
get() = getEntityData().entitySource
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).entitySource = value
|
||||
changedProperty.add("entitySource")
|
||||
|
||||
}
|
||||
override var name: String
|
||||
get() = getEntityData().name
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).name = value
|
||||
changedProperty.add("name")
|
||||
}
|
||||
private val rootsUpdater: (value: List<KotlinScriptLibraryRoot>) -> Unit = { value ->
|
||||
|
||||
changedProperty.add("roots")
|
||||
}
|
||||
override var roots: MutableList<KotlinScriptLibraryRoot>
|
||||
get() {
|
||||
val collection_roots = getEntityData().roots
|
||||
if (collection_roots !is MutableWorkspaceList) return collection_roots
|
||||
if (diff == null || modifiable.get()) {
|
||||
collection_roots.setModificationUpdateAction(rootsUpdater)
|
||||
} else {
|
||||
collection_roots.cleanModificationUpdateAction()
|
||||
}
|
||||
return collection_roots
|
||||
}
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).roots = value
|
||||
rootsUpdater.invoke(value)
|
||||
}
|
||||
override var indexSourceRoots: Boolean
|
||||
get() = getEntityData().indexSourceRoots
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).indexSourceRoots = value
|
||||
changedProperty.add("indexSourceRoots")
|
||||
}
|
||||
private val usedInScriptsUpdater: (value: Set<KotlinScriptId>) -> Unit = { value ->
|
||||
|
||||
changedProperty.add("usedInScripts")
|
||||
}
|
||||
override var usedInScripts: MutableSet<KotlinScriptId>
|
||||
get() {
|
||||
val collection_usedInScripts = getEntityData().usedInScripts
|
||||
if (collection_usedInScripts !is MutableWorkspaceSet) return collection_usedInScripts
|
||||
if (diff == null || modifiable.get()) {
|
||||
collection_usedInScripts.setModificationUpdateAction(usedInScriptsUpdater)
|
||||
} else {
|
||||
collection_usedInScripts.cleanModificationUpdateAction()
|
||||
}
|
||||
return collection_usedInScripts
|
||||
}
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).usedInScripts = value
|
||||
usedInScriptsUpdater.invoke(value)
|
||||
}
|
||||
|
||||
override fun getEntityClass(): Class<KotlinScriptLibraryEntity> = KotlinScriptLibraryEntity::class.java
|
||||
}
|
||||
override var usedInScripts: MutableSet<KotlinScriptId>
|
||||
get() {
|
||||
val collection_usedInScripts = getEntityData().usedInScripts
|
||||
if (collection_usedInScripts !is MutableWorkspaceSet) return collection_usedInScripts
|
||||
if (diff == null || modifiable.get()) {
|
||||
collection_usedInScripts.setModificationUpdateAction(usedInScriptsUpdater)
|
||||
}
|
||||
else {
|
||||
collection_usedInScripts.cleanModificationUpdateAction()
|
||||
}
|
||||
return collection_usedInScripts
|
||||
}
|
||||
set(value) {
|
||||
checkModificationAllowed()
|
||||
getEntityData(true).usedInScripts = value
|
||||
usedInScriptsUpdater.invoke(value)
|
||||
}
|
||||
|
||||
override fun getEntityClass(): Class<KotlinScriptLibraryEntity> = KotlinScriptLibraryEntity::class.java
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@OptIn(WorkspaceEntityInternalApi::class)
|
||||
internal class KotlinScriptLibraryEntityData : WorkspaceEntityData<KotlinScriptLibraryEntity>(), SoftLinkable {
|
||||
lateinit var name: String
|
||||
lateinit var roots: MutableList<KotlinScriptLibraryRoot>
|
||||
var indexSourceRoots: Boolean = false
|
||||
lateinit var usedInScripts: MutableSet<KotlinScriptId>
|
||||
lateinit var name: String
|
||||
lateinit var roots: MutableList<KotlinScriptLibraryRoot>
|
||||
var indexSourceRoots: Boolean = false
|
||||
lateinit var usedInScripts: MutableSet<KotlinScriptId>
|
||||
|
||||
internal fun isNameInitialized(): Boolean = ::name.isInitialized
|
||||
internal fun isRootsInitialized(): Boolean = ::roots.isInitialized
|
||||
internal fun isNameInitialized(): Boolean = ::name.isInitialized
|
||||
internal fun isRootsInitialized(): Boolean = ::roots.isInitialized
|
||||
|
||||
internal fun isUsedInScriptsInitialized(): Boolean = ::usedInScripts.isInitialized
|
||||
internal fun isUsedInScriptsInitialized(): Boolean = ::usedInScripts.isInitialized
|
||||
|
||||
override fun getLinks(): Set<SymbolicEntityId<*>> {
|
||||
val result = HashSet<SymbolicEntityId<*>>()
|
||||
for (item in roots) {
|
||||
override fun getLinks(): Set<SymbolicEntityId<*>> {
|
||||
val result = HashSet<SymbolicEntityId<*>>()
|
||||
for (item in roots) {
|
||||
}
|
||||
for (item in usedInScripts) {
|
||||
result.add(item)
|
||||
}
|
||||
return result
|
||||
}
|
||||
for (item in usedInScripts) {
|
||||
result.add(item)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
override fun index(index: WorkspaceMutableIndex<SymbolicEntityId<*>>) {
|
||||
for (item in roots) {
|
||||
override fun index(index: WorkspaceMutableIndex<SymbolicEntityId<*>>) {
|
||||
for (item in roots) {
|
||||
}
|
||||
for (item in usedInScripts) {
|
||||
index.index(this, item)
|
||||
}
|
||||
}
|
||||
for (item in usedInScripts) {
|
||||
index.index(this, item)
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateLinksIndex(prev: Set<SymbolicEntityId<*>>, index: WorkspaceMutableIndex<SymbolicEntityId<*>>) {
|
||||
override fun updateLinksIndex(prev: Set<SymbolicEntityId<*>>, index: WorkspaceMutableIndex<SymbolicEntityId<*>>) {
|
||||
// TODO verify logic
|
||||
val mutablePreviousSet = HashSet(prev)
|
||||
for (item in roots) {
|
||||
val mutablePreviousSet = HashSet(prev)
|
||||
for (item in roots) {
|
||||
}
|
||||
for (item in usedInScripts) {
|
||||
val removedItem_item = mutablePreviousSet.remove(item)
|
||||
if (!removedItem_item) {
|
||||
index.index(this, item)
|
||||
}
|
||||
}
|
||||
for (removed in mutablePreviousSet) {
|
||||
index.remove(this, removed)
|
||||
}
|
||||
}
|
||||
for (item in usedInScripts) {
|
||||
val removedItem_item = mutablePreviousSet.remove(item)
|
||||
if (!removedItem_item) {
|
||||
index.index(this, item)
|
||||
}
|
||||
|
||||
override fun updateLink(oldLink: SymbolicEntityId<*>, newLink: SymbolicEntityId<*>): Boolean {
|
||||
var changed = false
|
||||
val usedInScripts_data = usedInScripts.map {
|
||||
val it_data = if (it == oldLink) {
|
||||
changed = true
|
||||
newLink as KotlinScriptId
|
||||
} else {
|
||||
null
|
||||
}
|
||||
if (it_data != null) {
|
||||
it_data
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}
|
||||
if (usedInScripts_data != null) {
|
||||
usedInScripts = usedInScripts_data as MutableSet<KotlinScriptId>
|
||||
}
|
||||
return changed
|
||||
}
|
||||
for (removed in mutablePreviousSet) {
|
||||
index.remove(this, removed)
|
||||
|
||||
override fun wrapAsModifiable(diff: MutableEntityStorage): WorkspaceEntityBuilder<KotlinScriptLibraryEntity> {
|
||||
val modifiable = KotlinScriptLibraryEntityImpl.Builder(null)
|
||||
modifiable.diff = diff
|
||||
modifiable.id = createEntityId()
|
||||
return modifiable
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateLink(oldLink: SymbolicEntityId<*>, newLink: SymbolicEntityId<*>): Boolean {
|
||||
var changed = false
|
||||
val usedInScripts_data = usedInScripts.map {
|
||||
val it_data = if (it == oldLink) {
|
||||
changed = true
|
||||
newLink as KotlinScriptId
|
||||
}
|
||||
else {
|
||||
null
|
||||
}
|
||||
if (it_data != null) {
|
||||
it_data
|
||||
}
|
||||
else {
|
||||
it
|
||||
}
|
||||
@OptIn(EntityStorageInstrumentationApi::class)
|
||||
override fun createEntity(snapshot: EntityStorageInstrumentation): KotlinScriptLibraryEntity {
|
||||
val entityId = createEntityId()
|
||||
return snapshot.initializeEntity(entityId) {
|
||||
val entity = KotlinScriptLibraryEntityImpl(this)
|
||||
entity.snapshot = snapshot
|
||||
entity.id = entityId
|
||||
entity
|
||||
}
|
||||
}
|
||||
if (usedInScripts_data != null) {
|
||||
usedInScripts = usedInScripts_data as MutableSet<KotlinScriptId>
|
||||
|
||||
override fun getMetadata(): EntityMetadata {
|
||||
return MetadataStorageImpl.getMetadataByTypeFqn("org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryEntity") as EntityMetadata
|
||||
}
|
||||
return changed
|
||||
}
|
||||
|
||||
override fun wrapAsModifiable(diff: MutableEntityStorage): WorkspaceEntityBuilder<KotlinScriptLibraryEntity> {
|
||||
val modifiable = KotlinScriptLibraryEntityImpl.Builder(null)
|
||||
modifiable.diff = diff
|
||||
modifiable.id = createEntityId()
|
||||
return modifiable
|
||||
}
|
||||
|
||||
@OptIn(EntityStorageInstrumentationApi::class)
|
||||
override fun createEntity(snapshot: EntityStorageInstrumentation): KotlinScriptLibraryEntity {
|
||||
val entityId = createEntityId()
|
||||
return snapshot.initializeEntity(entityId) {
|
||||
val entity = KotlinScriptLibraryEntityImpl(this)
|
||||
entity.snapshot = snapshot
|
||||
entity.id = entityId
|
||||
entity
|
||||
override fun clone(): KotlinScriptLibraryEntityData {
|
||||
val clonedEntity = super.clone()
|
||||
clonedEntity as KotlinScriptLibraryEntityData
|
||||
clonedEntity.roots = clonedEntity.roots.toMutableWorkspaceList()
|
||||
clonedEntity.usedInScripts = clonedEntity.usedInScripts.toMutableWorkspaceSet()
|
||||
return clonedEntity
|
||||
}
|
||||
}
|
||||
|
||||
override fun getMetadata(): EntityMetadata {
|
||||
return MetadataStorageImpl.getMetadataByTypeFqn("org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryEntity") as EntityMetadata
|
||||
}
|
||||
override fun getEntityInterface(): Class<out WorkspaceEntity> {
|
||||
return KotlinScriptLibraryEntity::class.java
|
||||
}
|
||||
|
||||
override fun clone(): KotlinScriptLibraryEntityData {
|
||||
val clonedEntity = super.clone()
|
||||
clonedEntity as KotlinScriptLibraryEntityData
|
||||
clonedEntity.roots = clonedEntity.roots.toMutableWorkspaceList()
|
||||
clonedEntity.usedInScripts = clonedEntity.usedInScripts.toMutableWorkspaceSet()
|
||||
return clonedEntity
|
||||
}
|
||||
override fun createDetachedEntity(parents: List<WorkspaceEntityBuilder<*>>): WorkspaceEntityBuilder<*> {
|
||||
return KotlinScriptLibraryEntity(name, roots, indexSourceRoots, usedInScripts, entitySource)
|
||||
}
|
||||
|
||||
override fun getEntityInterface(): Class<out WorkspaceEntity> {
|
||||
return KotlinScriptLibraryEntity::class.java
|
||||
}
|
||||
override fun getRequiredParents(): List<Class<out WorkspaceEntity>> {
|
||||
val res = mutableListOf<Class<out WorkspaceEntity>>()
|
||||
return res
|
||||
}
|
||||
|
||||
override fun createDetachedEntity(parents: List<WorkspaceEntityBuilder<*>>): WorkspaceEntityBuilder<*> {
|
||||
return KotlinScriptLibraryEntity(name, roots, indexSourceRoots, usedInScripts, entitySource)
|
||||
}
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other == null) return false
|
||||
if (this.javaClass != other.javaClass) return false
|
||||
other as KotlinScriptLibraryEntityData
|
||||
if (this.entitySource != other.entitySource) return false
|
||||
if (this.name != other.name) return false
|
||||
if (this.roots != other.roots) return false
|
||||
if (this.indexSourceRoots != other.indexSourceRoots) return false
|
||||
if (this.usedInScripts != other.usedInScripts) return false
|
||||
return true
|
||||
}
|
||||
|
||||
override fun getRequiredParents(): List<Class<out WorkspaceEntity>> {
|
||||
val res = mutableListOf<Class<out WorkspaceEntity>>()
|
||||
return res
|
||||
}
|
||||
override fun equalsIgnoringEntitySource(other: Any?): Boolean {
|
||||
if (other == null) return false
|
||||
if (this.javaClass != other.javaClass) return false
|
||||
other as KotlinScriptLibraryEntityData
|
||||
if (this.name != other.name) return false
|
||||
if (this.roots != other.roots) return false
|
||||
if (this.indexSourceRoots != other.indexSourceRoots) return false
|
||||
if (this.usedInScripts != other.usedInScripts) return false
|
||||
return true
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other == null) return false
|
||||
if (this.javaClass != other.javaClass) return false
|
||||
other as KotlinScriptLibraryEntityData
|
||||
if (this.entitySource != other.entitySource) return false
|
||||
if (this.name != other.name) return false
|
||||
if (this.roots != other.roots) return false
|
||||
if (this.indexSourceRoots != other.indexSourceRoots) return false
|
||||
if (this.usedInScripts != other.usedInScripts) return false
|
||||
return true
|
||||
}
|
||||
override fun hashCode(): Int {
|
||||
var result = entitySource.hashCode()
|
||||
result = 31 * result + name.hashCode()
|
||||
result = 31 * result + roots.hashCode()
|
||||
result = 31 * result + indexSourceRoots.hashCode()
|
||||
result = 31 * result + usedInScripts.hashCode()
|
||||
return result
|
||||
}
|
||||
|
||||
override fun equalsIgnoringEntitySource(other: Any?): Boolean {
|
||||
if (other == null) return false
|
||||
if (this.javaClass != other.javaClass) return false
|
||||
other as KotlinScriptLibraryEntityData
|
||||
if (this.name != other.name) return false
|
||||
if (this.roots != other.roots) return false
|
||||
if (this.indexSourceRoots != other.indexSourceRoots) return false
|
||||
if (this.usedInScripts != other.usedInScripts) return false
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = entitySource.hashCode()
|
||||
result = 31 * result + name.hashCode()
|
||||
result = 31 * result + roots.hashCode()
|
||||
result = 31 * result + indexSourceRoots.hashCode()
|
||||
result = 31 * result + usedInScripts.hashCode()
|
||||
return result
|
||||
}
|
||||
|
||||
override fun hashCodeIgnoringEntitySource(): Int {
|
||||
var result = javaClass.hashCode()
|
||||
result = 31 * result + name.hashCode()
|
||||
result = 31 * result + roots.hashCode()
|
||||
result = 31 * result + indexSourceRoots.hashCode()
|
||||
result = 31 * result + usedInScripts.hashCode()
|
||||
return result
|
||||
}
|
||||
override fun hashCodeIgnoringEntitySource(): Int {
|
||||
var result = javaClass.hashCode()
|
||||
result = 31 * result + name.hashCode()
|
||||
result = 31 * result + roots.hashCode()
|
||||
result = 31 * result + indexSourceRoots.hashCode()
|
||||
result = 31 * result + usedInScripts.hashCode()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
+393
-265
@@ -11,283 +11,411 @@ import com.intellij.platform.workspace.storage.metadata.model.ValueTypeMetadata
|
||||
|
||||
@OptIn(WorkspaceEntityInternalApi::class)
|
||||
internal object MetadataStorageImpl : MetadataStorageBase() {
|
||||
override fun initializeMetadata() {
|
||||
val primitiveTypeStringNotNullable = ValueTypeMetadata.SimpleType.PrimitiveType(isNullable = false, type = "String")
|
||||
val primitiveTypeSetNotNullable = ValueTypeMetadata.SimpleType.PrimitiveType(isNullable = false, type = "Set")
|
||||
val primitiveTypeListNotNullable = ValueTypeMetadata.SimpleType.PrimitiveType(isNullable = false, type = "List")
|
||||
val primitiveTypeBooleanNotNullable = ValueTypeMetadata.SimpleType.PrimitiveType(isNullable = false, type = "Boolean")
|
||||
override fun initializeMetadata() {
|
||||
val primitiveTypeStringNotNullable =
|
||||
ValueTypeMetadata.SimpleType.PrimitiveType(isNullable = false, type = "String")
|
||||
val primitiveTypeSetNotNullable = ValueTypeMetadata.SimpleType.PrimitiveType(isNullable = false, type = "Set")
|
||||
val primitiveTypeListNotNullable = ValueTypeMetadata.SimpleType.PrimitiveType(isNullable = false, type = "List")
|
||||
val primitiveTypeBooleanNotNullable =
|
||||
ValueTypeMetadata.SimpleType.PrimitiveType(isNullable = false, type = "Boolean")
|
||||
|
||||
var typeMetadata: StorageTypeMetadata
|
||||
var typeMetadata: StorageTypeMetadata
|
||||
|
||||
typeMetadata =
|
||||
FinalClassMetadata.ClassMetadata(fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryEntitySource",
|
||||
properties = listOf(OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "virtualFileUrl",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = true,
|
||||
typeMetadata = FinalClassMetadata.KnownClass(fqName = "com.intellij.platform.workspace.storage.url.VirtualFileUrl")),
|
||||
withDefault = false)),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.EntitySource"))
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryEntitySource",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "virtualFileUrl",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = true,
|
||||
typeMetadata = FinalClassMetadata.KnownClass(fqName = "com.intellij.platform.workspace.storage.url.VirtualFileUrl")
|
||||
),
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.EntitySource")
|
||||
)
|
||||
|
||||
addMetadata(typeMetadata)
|
||||
addMetadata(typeMetadata)
|
||||
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptEntitySource",
|
||||
properties = listOf(OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "virtualFileUrl",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = true,
|
||||
typeMetadata = FinalClassMetadata.KnownClass(
|
||||
fqName = "com.intellij.platform.workspace.storage.url.VirtualFileUrl")),
|
||||
withDefault = false)),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.EntitySource"))
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptEntitySource",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "virtualFileUrl",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = true,
|
||||
typeMetadata = FinalClassMetadata.KnownClass(fqName = "com.intellij.platform.workspace.storage.url.VirtualFileUrl")
|
||||
),
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.EntitySource")
|
||||
)
|
||||
|
||||
addMetadata(typeMetadata)
|
||||
addMetadata(typeMetadata)
|
||||
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryId",
|
||||
properties = listOf(OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "name",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false)),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.SymbolicEntityId"))
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "name",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.SymbolicEntityId")
|
||||
)
|
||||
|
||||
addMetadata(typeMetadata)
|
||||
addMetadata(typeMetadata)
|
||||
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptId",
|
||||
properties = listOf(OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "path",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false)),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.SymbolicEntityId"))
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "path",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.SymbolicEntityId")
|
||||
)
|
||||
|
||||
addMetadata(typeMetadata)
|
||||
addMetadata(typeMetadata)
|
||||
|
||||
typeMetadata = EntityMetadata(fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptEntity",
|
||||
entityDataFqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.impl.KotlinScriptEntityData",
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.WorkspaceEntity",
|
||||
"com.intellij.platform.workspace.storage.WorkspaceEntityWithSymbolicId"),
|
||||
properties = listOf(OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "entitySource",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.KnownClass(
|
||||
fqName = "com.intellij.platform.workspace.storage.EntitySource")),
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "path",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "dependencies",
|
||||
valueType = ValueTypeMetadata.ParameterizedType(generics = listOf(
|
||||
ValueTypeMetadata.SimpleType.CustomType(isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "name",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false)),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.SymbolicEntityId")))),
|
||||
primitive = primitiveTypeSetNotNullable),
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(isComputable = true,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "symbolicId",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "path",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false)),
|
||||
supertypes = listOf(
|
||||
"com.intellij.platform.workspace.storage.SymbolicEntityId"))),
|
||||
withDefault = false)),
|
||||
extProperties = listOf(),
|
||||
isAbstract = false)
|
||||
typeMetadata = EntityMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptEntity",
|
||||
entityDataFqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.impl.KotlinScriptEntityData",
|
||||
supertypes = listOf(
|
||||
"com.intellij.platform.workspace.storage.WorkspaceEntity",
|
||||
"com.intellij.platform.workspace.storage.WorkspaceEntityWithSymbolicId"
|
||||
),
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "entitySource",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.KnownClass(fqName = "com.intellij.platform.workspace.storage.EntitySource")
|
||||
),
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "path",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "dependencies",
|
||||
valueType = ValueTypeMetadata.ParameterizedType(
|
||||
generics = listOf(
|
||||
ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "name",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.SymbolicEntityId")
|
||||
)
|
||||
)
|
||||
), primitive = primitiveTypeSetNotNullable
|
||||
),
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = true,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "symbolicId",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "path",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.SymbolicEntityId")
|
||||
)
|
||||
),
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
extProperties = listOf(),
|
||||
isAbstract = false
|
||||
)
|
||||
|
||||
addMetadata(typeMetadata)
|
||||
addMetadata(typeMetadata)
|
||||
|
||||
typeMetadata = EntityMetadata(fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryEntity",
|
||||
entityDataFqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.impl.KotlinScriptLibraryEntityData",
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.WorkspaceEntity",
|
||||
"com.intellij.platform.workspace.storage.WorkspaceEntityWithSymbolicId"),
|
||||
properties = listOf(OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "entitySource",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.KnownClass(
|
||||
fqName = "com.intellij.platform.workspace.storage.EntitySource")),
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "name",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "roots",
|
||||
valueType = ValueTypeMetadata.ParameterizedType(generics = listOf(
|
||||
ValueTypeMetadata.SimpleType.CustomType(isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryRoot",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "type",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryRootTypeId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "name",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false)),
|
||||
supertypes = listOf(
|
||||
"java.io.Serializable"))),
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "url",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.KnownClass(
|
||||
fqName = "com.intellij.platform.workspace.storage.url.VirtualFileUrl")),
|
||||
withDefault = false)),
|
||||
supertypes = listOf("java.io.Serializable")))),
|
||||
primitive = primitiveTypeListNotNullable),
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "indexSourceRoots",
|
||||
valueType = primitiveTypeBooleanNotNullable,
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "usedInScripts",
|
||||
valueType = ValueTypeMetadata.ParameterizedType(generics = listOf(
|
||||
ValueTypeMetadata.SimpleType.CustomType(isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "path",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false)),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.SymbolicEntityId")))),
|
||||
primitive = primitiveTypeSetNotNullable),
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(isComputable = true,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "symbolicId",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "name",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false)),
|
||||
supertypes = listOf(
|
||||
"com.intellij.platform.workspace.storage.SymbolicEntityId"))),
|
||||
withDefault = false)),
|
||||
extProperties = listOf(),
|
||||
isAbstract = false)
|
||||
typeMetadata = EntityMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryEntity",
|
||||
entityDataFqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.impl.KotlinScriptLibraryEntityData",
|
||||
supertypes = listOf(
|
||||
"com.intellij.platform.workspace.storage.WorkspaceEntity",
|
||||
"com.intellij.platform.workspace.storage.WorkspaceEntityWithSymbolicId"
|
||||
),
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "entitySource",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.KnownClass(fqName = "com.intellij.platform.workspace.storage.EntitySource")
|
||||
),
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "name",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "roots",
|
||||
valueType = ValueTypeMetadata.ParameterizedType(
|
||||
generics = listOf(
|
||||
ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryRoot",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "type",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryRootTypeId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "name",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
supertypes = listOf("java.io.Serializable")
|
||||
)
|
||||
),
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "url",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.KnownClass(fqName = "com.intellij.platform.workspace.storage.url.VirtualFileUrl")
|
||||
),
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
supertypes = listOf("java.io.Serializable")
|
||||
)
|
||||
)
|
||||
), primitive = primitiveTypeListNotNullable
|
||||
),
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "indexSourceRoots",
|
||||
valueType = primitiveTypeBooleanNotNullable,
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "usedInScripts",
|
||||
valueType = ValueTypeMetadata.ParameterizedType(
|
||||
generics = listOf(
|
||||
ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "path",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.SymbolicEntityId")
|
||||
)
|
||||
)
|
||||
), primitive = primitiveTypeSetNotNullable
|
||||
),
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = true,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "symbolicId",
|
||||
valueType = ValueTypeMetadata.SimpleType.CustomType(
|
||||
isNullable = false,
|
||||
typeMetadata = FinalClassMetadata.ClassMetadata(
|
||||
fqName = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryId",
|
||||
properties = listOf(
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "name",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
),
|
||||
OwnPropertyMetadata(
|
||||
isComputable = false,
|
||||
isKey = false,
|
||||
isOpen = false,
|
||||
name = "presentableName",
|
||||
valueType = primitiveTypeStringNotNullable,
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
supertypes = listOf("com.intellij.platform.workspace.storage.SymbolicEntityId")
|
||||
)
|
||||
),
|
||||
withDefault = false
|
||||
)
|
||||
),
|
||||
extProperties = listOf(),
|
||||
isAbstract = false
|
||||
)
|
||||
|
||||
addMetadata(typeMetadata)
|
||||
}
|
||||
addMetadata(typeMetadata)
|
||||
}
|
||||
|
||||
override fun initializeMetadataHash() {
|
||||
addMetadataHash(typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptEntity", metadataHash = 28529041)
|
||||
addMetadataHash(typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryEntity", metadataHash = 1720086036)
|
||||
addMetadataHash(typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryId", metadataHash = 1339490769)
|
||||
addMetadataHash(typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptId", metadataHash = 771684902)
|
||||
addMetadataHash(typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryRoot", metadataHash = 1494240429)
|
||||
addMetadataHash(typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryRootTypeId", metadataHash = 535707220)
|
||||
addMetadataHash(typeFqn = "com.intellij.platform.workspace.storage.EntitySource", metadataHash = 444396911)
|
||||
addMetadataHash(typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptEntitySource", metadataHash = -239581324)
|
||||
addMetadataHash(typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryEntitySource", metadataHash = 1187525315)
|
||||
addMetadataHash(typeFqn = "com.intellij.platform.workspace.storage.SymbolicEntityId", metadataHash = -1251885517)
|
||||
}
|
||||
override fun initializeMetadataHash() {
|
||||
addMetadataHash(
|
||||
typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptEntity",
|
||||
metadataHash = 28529041
|
||||
)
|
||||
addMetadataHash(
|
||||
typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryEntity",
|
||||
metadataHash = 1720086036
|
||||
)
|
||||
addMetadataHash(
|
||||
typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryId",
|
||||
metadataHash = 1339490769
|
||||
)
|
||||
addMetadataHash(
|
||||
typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptId",
|
||||
metadataHash = 771684902
|
||||
)
|
||||
addMetadataHash(
|
||||
typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryRoot",
|
||||
metadataHash = 1494240429
|
||||
)
|
||||
addMetadataHash(
|
||||
typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryRootTypeId",
|
||||
metadataHash = 535707220
|
||||
)
|
||||
addMetadataHash(typeFqn = "com.intellij.platform.workspace.storage.EntitySource", metadataHash = 444396911)
|
||||
addMetadataHash(
|
||||
typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptEntitySource",
|
||||
metadataHash = -239581324
|
||||
)
|
||||
addMetadataHash(
|
||||
typeFqn = "org.jetbrains.kotlin.idea.core.script.k1.ucache.KotlinScriptLibraryEntitySource",
|
||||
metadataHash = 1187525315
|
||||
)
|
||||
addMetadataHash(
|
||||
typeFqn = "com.intellij.platform.workspace.storage.SymbolicEntityId",
|
||||
metadataHash = -1251885517
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user