mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
[editor] IJPL-54 Move DocumentEntity to separate module depending on kernel and andel
GitOrigin-RevId: 9c3e3b1bb9a003e8b273302fa8c19f6e56e91a10
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8b94d67062
commit
f50ea14677
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@@ -817,6 +817,7 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/object-serializer/intellij.platform.objectSerializer.iml" filepath="$PROJECT_DIR$/platform/object-serializer/intellij.platform.objectSerializer.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/object-serializer/intellij.platform.objectSerializer.annotations.iml" filepath="$PROJECT_DIR$/platform/object-serializer/intellij.platform.objectSerializer.annotations.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/object-serializer/intellij.platform.objectSerializer.tests.iml" filepath="$PROJECT_DIR$/platform/object-serializer/intellij.platform.objectSerializer.tests.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/kernel/pasta/intellij.platform.pasta.iml" filepath="$PROJECT_DIR$/platform/kernel/pasta/intellij.platform.pasta.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/progress/backend/intellij.platform.progress.backend.iml" filepath="$PROJECT_DIR$/platform/progress/backend/intellij.platform.progress.backend.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/project/shared/intellij.platform.project.iml" filepath="$PROJECT_DIR$/platform/project/shared/intellij.platform.project.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/project/backend/intellij.platform.project.backend.iml" filepath="$PROJECT_DIR$/platform/project/backend/intellij.platform.project.backend.iml" />
|
||||
|
||||
@@ -13,5 +13,6 @@
|
||||
<orderEntry type="library" name="kotlinx-serialization-core" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.kernel" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.impl" />
|
||||
<orderEntry type="module" module-name="intellij.platform.pasta" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -3,8 +3,8 @@ package com.intellij.platform.editor
|
||||
|
||||
import com.intellij.openapi.application.isRhizomeAdEnabled
|
||||
import com.intellij.openapi.editor.impl.ad.AdDocumentEntity
|
||||
import com.intellij.platform.kernel.editor.pasta.common.DocumentEntity
|
||||
import com.intellij.platform.kernel.editor.pasta.common.EditLogEntity
|
||||
import com.intellij.platform.pasta.common.DocumentEntity
|
||||
import com.intellij.platform.pasta.common.EditLogEntity
|
||||
import com.intellij.platform.kernel.EntityTypeProvider
|
||||
import com.jetbrains.rhizomedb.EntityType
|
||||
|
||||
|
||||
0
platform/kernel/pasta/api-dump.txt
Normal file
0
platform/kernel/pasta/api-dump.txt
Normal file
48
platform/kernel/pasta/intellij.platform.pasta.iml
Normal file
48
platform/kernel/pasta/intellij.platform.pasta.iml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="5" platform="JVM 17" allPlatforms="JVM [17]" useProjectSettings="false">
|
||||
<compilerSettings>
|
||||
<option name="additionalArguments" value="-Xjvm-default=all" />
|
||||
</compilerSettings>
|
||||
<compilerArguments>
|
||||
<stringArguments>
|
||||
<stringArg name="jvmTarget" arg="17" />
|
||||
<stringArg name="apiVersion" arg="2.0" />
|
||||
<stringArg name="languageVersion" arg="2.0" />
|
||||
</stringArguments>
|
||||
<arrayArguments>
|
||||
<arrayArg name="pluginClasspaths">
|
||||
<args>
|
||||
<arg>$KOTLIN_BUNDLED$/lib/kotlinx-serialization-compiler-plugin.jar</arg>
|
||||
<arg>$MAVEN_REPOSITORY$/jetbrains/fleet/rhizomedb-compiler-plugin/2.1.10-0.1/rhizomedb-compiler-plugin-2.1.10-0.1.jar</arg>
|
||||
</args>
|
||||
</arrayArg>
|
||||
<arrayArg name="pluginOptions" />
|
||||
</arrayArguments>
|
||||
</compilerArguments>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/" isTestSource="false" packagePrefix="com.intellij.platform.pasta" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="kotlin-stdlib" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.rpc" exported="" />
|
||||
<orderEntry type="module" module-name="fleet.andel" exported="" />
|
||||
<orderEntry type="module" module-name="fleet.kernel" exported="" />
|
||||
<orderEntry type="library" name="kotlinx-coroutines-core" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-collections-immutable" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-serialization-core" level="project" />
|
||||
<orderEntry type="library" name="fastutil-min" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.core" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.coroutines" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import andel.editor.AnchorId
|
||||
import andel.editor.DocumentComponent
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import andel.editor.*
|
||||
import andel.intervals.AnchorStorage
|
||||
@@ -41,7 +41,7 @@ internal class DbMutableDocument(
|
||||
private set
|
||||
get() {
|
||||
val res = MutableBoundedOpenMap.emptyBounded<MutableDocument, DocumentComponent>()
|
||||
val components = entities(DocumentComponentEntity.DocumentAttr, dbDocument)
|
||||
val components = entities(DocumentComponentEntity.Companion.DocumentAttr, dbDocument)
|
||||
for (c in components) {
|
||||
val key = c.getKey()
|
||||
res.update(key as DocumentComponentKey<DocumentComponent>) { existing ->
|
||||
@@ -64,10 +64,11 @@ internal class DbMutableDocument(
|
||||
val versionedOperation = captureOperation(operation)
|
||||
|
||||
changeScope.maybeShared(dbDocument) {
|
||||
mutate(ChangeDocument(
|
||||
operationId = UID.random(),
|
||||
documentId = dbDocument.eid,
|
||||
operation = versionedOperation.rebase(this@DbMutableDocument)),
|
||||
mutate(
|
||||
ChangeDocument(
|
||||
operationId = UID.random(),
|
||||
documentId = dbDocument.eid,
|
||||
operation = versionedOperation.rebase(this@DbMutableDocument)),
|
||||
)
|
||||
}
|
||||
val textAfter = text
|
||||
@@ -87,7 +88,7 @@ internal class DbMutableDocument(
|
||||
override fun removeAnchor(anchorId: AnchorId) {
|
||||
intermediateAnchorStorage = intermediateAnchorStorage.removeAnchor(anchorId)
|
||||
with(changeScope) {
|
||||
entity(LocalAnchor.AnchorIdAttr, anchorId)?.delete()
|
||||
entity(LocalAnchor.Companion.AnchorIdAttr, anchorId)?.delete()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +116,7 @@ internal class DbMutableDocument(
|
||||
override fun removeRangeMarker(markerId: RangeMarkerId) {
|
||||
intermediateAnchorStorage = intermediateAnchorStorage.removeRangeMarker(markerId)
|
||||
with(changeScope) {
|
||||
entity(LocalRangeMarker.RangeMarkerIdAttr, markerId)?.delete()
|
||||
entity(LocalRangeMarker.Companion.RangeMarkerIdAttr, markerId)?.delete()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,17 +126,17 @@ internal class DbMutableDocument(
|
||||
) {
|
||||
with(changeScope) {
|
||||
val storage = ensureLocalAnchorStorageCreated(dbDocument)
|
||||
storage[LocalAnchorStorageEntity.AnchorStorageAttr] = storage.anchorStorage.batchUpdate(anchorIds, anchorOffsets, rangeIds, ranges)
|
||||
storage[LocalAnchorStorageEntity.Companion.AnchorStorageAttr] = storage.anchorStorage.batchUpdate(anchorIds, anchorOffsets, rangeIds, ranges)
|
||||
anchorIds.forEach { anchorId ->
|
||||
entity(LocalAnchor.AnchorIdAttr, anchorId) ?: LocalAnchor.new {
|
||||
it[LocalAnchor.AnchorIdAttr] = anchorId
|
||||
it[LocalAnchor.AnchorStorageAttr] = storage
|
||||
entity(LocalAnchor.Companion.AnchorIdAttr, anchorId) ?: LocalAnchor.Companion.new {
|
||||
it[LocalAnchor.Companion.AnchorIdAttr] = anchorId
|
||||
it[LocalAnchor.Companion.AnchorStorageAttr] = storage
|
||||
}
|
||||
}
|
||||
rangeIds.forEach { rangeMarkerId ->
|
||||
entity(LocalRangeMarker.RangeMarkerIdAttr, rangeMarkerId) ?: LocalRangeMarker.new {
|
||||
it[LocalRangeMarker.RangeMarkerIdAttr] = rangeMarkerId
|
||||
it[LocalRangeMarker.AnchorStorageAttr] = storage
|
||||
entity(LocalRangeMarker.Companion.RangeMarkerIdAttr, rangeMarkerId) ?: LocalRangeMarker.Companion.new {
|
||||
it[LocalRangeMarker.Companion.RangeMarkerIdAttr] = rangeMarkerId
|
||||
it[LocalRangeMarker.Companion.AnchorStorageAttr] = storage
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import andel.operation.Operation
|
||||
import andel.operation.isIdentity
|
||||
@@ -83,17 +83,17 @@ data class ChangeDocument(
|
||||
listOf(
|
||||
Op.Assert(
|
||||
eid = documentId,
|
||||
attribute = DocumentEntity.TextAttr.attr,
|
||||
attribute = DocumentEntity.Companion.TextAttr.attr,
|
||||
value = textAfter,
|
||||
),
|
||||
Op.Assert(
|
||||
eid = documentId,
|
||||
attribute = DocumentEntity.SharedAnchorStorageAttr.attr,
|
||||
attribute = DocumentEntity.Companion.SharedAnchorStorageAttr.attr,
|
||||
value = document.sharedAnchorStorage.edit(textBefore, textAfter, operation),
|
||||
),
|
||||
Op.Assert(
|
||||
eid = editLog.eid,
|
||||
attribute = EditLogEntity.EditLogAttr.attr,
|
||||
attribute = EditLogEntity.Companion.EditLogAttr.attr,
|
||||
value = editLog.editLog.append(operationId, operation),
|
||||
),
|
||||
)
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import andel.editor.DocumentComponent
|
||||
import andel.editor.DocumentComponentKey
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import andel.editor.*
|
||||
import andel.intervals.AnchorStorage
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import andel.operation.EditLog
|
||||
import com.jetbrains.rhizomedb.ChangeScope
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import andel.editor.AnchorId
|
||||
import andel.operation.Sticky
|
||||
@@ -35,7 +35,7 @@ internal data class LocalAnchor(override val eid: EID) : RetractableEntity, Enti
|
||||
val anchorId = anchorId
|
||||
return RetractableEntity.Callback {
|
||||
if (anchorStorage.exists()) {
|
||||
anchorStorage[LocalAnchorStorageEntity.AnchorStorageAttr] = anchorStorage.anchorStorage.removeAnchor(anchorId)
|
||||
anchorStorage[LocalAnchorStorageEntity.Companion.AnchorStorageAttr] = anchorStorage.anchorStorage.removeAnchor(anchorId)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ internal fun ChangeScope.createAnchor(
|
||||
): LocalAnchor {
|
||||
require(offset >= 0) { "Offset for the anchor should be >= 0" }
|
||||
val storage = ensureLocalAnchorStorageCreated(document)
|
||||
storage[LocalAnchorStorageEntity.AnchorStorageAttr] = storage.anchorStorage
|
||||
storage[LocalAnchorStorageEntity.Companion.AnchorStorageAttr] = storage.anchorStorage
|
||||
.removeAnchor(anchorId)
|
||||
.addAnchor(anchorId, offset, sticky)
|
||||
return entity(LocalAnchor.AnchorIdAttr, anchorId) ?: LocalAnchor.new {
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import andel.editor.AnchorId
|
||||
import andel.editor.DocumentComponentKey
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import andel.editor.RangeMarkerId
|
||||
import andel.editor.substring
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import andel.operation.Operation
|
||||
import andel.operation.Sticky
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.kernel.editor.pasta.common
|
||||
package com.intellij.platform.pasta.common
|
||||
|
||||
import com.jetbrains.rhizomedb.ChangeScope
|
||||
import com.jetbrains.rhizomedb.Entity
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.Internal
|
||||
package com.intellij.platform.kernel.editor.pasta.common;
|
||||
package com.intellij.platform.pasta.common;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
@@ -15,7 +15,6 @@
|
||||
<arrayArguments>
|
||||
<arrayArg name="pluginClasspaths">
|
||||
<args>
|
||||
<arg>$KOTLIN_BUNDLED$/lib/kotlinx-serialization-compiler-plugin.jar</arg>
|
||||
<arg>$MAVEN_REPOSITORY$/jetbrains/fleet/rhizomedb-compiler-plugin/2.1.10-0.1/rhizomedb-compiler-plugin-2.1.10-0.1.jar</arg>
|
||||
</args>
|
||||
</arrayArg>
|
||||
@@ -36,7 +35,6 @@
|
||||
<orderEntry type="library" name="kotlin-stdlib" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.rpc" exported="" />
|
||||
<orderEntry type="module" module-name="fleet.kernel" exported="" />
|
||||
<orderEntry type="module" module-name="fleet.andel" exported="" />
|
||||
<orderEntry type="library" name="kotlinx-coroutines-core" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-collections-immutable" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-serialization-core" level="project" />
|
||||
@@ -45,5 +43,6 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.util" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.core" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.coroutines" />
|
||||
<orderEntry type="module" module-name="intellij.platform.pasta" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -7,7 +7,7 @@ import com.intellij.openapi.application.asContextElement
|
||||
import com.intellij.openapi.extensions.ExtensionPointListener
|
||||
import com.intellij.openapi.extensions.PluginDescriptor
|
||||
import com.intellij.platform.kernel.EntityTypeProvider
|
||||
import com.intellij.platform.kernel.editor.pasta.common.ChangeDocument
|
||||
import com.intellij.platform.pasta.common.ChangeDocument
|
||||
import com.jetbrains.rhizomedb.*
|
||||
import fleet.kernel.*
|
||||
import fleet.kernel.rebase.*
|
||||
|
||||
@@ -13,5 +13,6 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.util.coroutines" />
|
||||
<orderEntry type="library" name="kotlinx-coroutines-core" level="project" />
|
||||
<orderEntry type="library" name="jetbrains-annotations" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.pasta" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.ide.bootstrap.kernel
|
||||
|
||||
import com.intellij.platform.kernel.editor.pasta.common.ChangeDocument
|
||||
import com.intellij.platform.pasta.common.ChangeDocument
|
||||
import com.intellij.platform.kernel.util.kernelCoroutineContext
|
||||
import com.jetbrains.rhizomedb.EffectInstruction
|
||||
import com.jetbrains.rhizomedb.MapAttribute
|
||||
|
||||
@@ -150,5 +150,6 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.buildData" />
|
||||
<orderEntry type="module" module-name="intellij.platform.syntax" scope="RUNTIME" />
|
||||
<orderEntry type="module" module-name="intellij.platform.syntax.psi" scope="RUNTIME" />
|
||||
<orderEntry type="module" module-name="intellij.platform.pasta" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -9,7 +9,7 @@ import com.intellij.openapi.editor.ex.DocumentEx
|
||||
import com.intellij.openapi.editor.ex.EditReadOnlyListener
|
||||
import com.intellij.openapi.editor.ex.LineIterator
|
||||
import com.intellij.openapi.editor.ex.RangeMarkerEx
|
||||
import com.intellij.platform.kernel.editor.pasta.common.DocumentEntity
|
||||
import com.intellij.platform.pasta.common.DocumentEntity
|
||||
import com.intellij.openapi.util.Key
|
||||
import com.intellij.openapi.util.TextRange
|
||||
import com.intellij.util.Processor
|
||||
|
||||
@@ -18,12 +18,12 @@ import com.intellij.openapi.editor.ex.PrioritizedDocumentListener
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil
|
||||
import com.intellij.openapi.editor.impl.EditorImpl
|
||||
import com.intellij.openapi.editor.impl.ad.ThreadLocalRhizomeDB
|
||||
import com.intellij.platform.kernel.editor.pasta.common.DocumentEntity
|
||||
import com.intellij.platform.kernel.editor.pasta.common.DocumentEntity.Companion.EditLogAttr
|
||||
import com.intellij.platform.kernel.editor.pasta.common.DocumentEntity.Companion.SharedAnchorStorageAttr
|
||||
import com.intellij.platform.kernel.editor.pasta.common.DocumentEntity.Companion.TextAttr
|
||||
import com.intellij.platform.kernel.editor.pasta.common.DocumentEntity.Companion.WritableAttr
|
||||
import com.intellij.platform.kernel.editor.pasta.common.createEmptyEditLog
|
||||
import com.intellij.platform.pasta.common.DocumentEntity
|
||||
import com.intellij.platform.pasta.common.DocumentEntity.Companion.EditLogAttr
|
||||
import com.intellij.platform.pasta.common.DocumentEntity.Companion.SharedAnchorStorageAttr
|
||||
import com.intellij.platform.pasta.common.DocumentEntity.Companion.TextAttr
|
||||
import com.intellij.platform.pasta.common.DocumentEntity.Companion.WritableAttr
|
||||
import com.intellij.platform.pasta.common.createEmptyEditLog
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
|
||||
Reference in New Issue
Block a user