diff --git a/.idea/modules.xml b/.idea/modules.xml index 739a18dd5ec0..6f7564d75210 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -817,6 +817,7 @@ + diff --git a/platform/editor/shared/intellij.platform.editor.iml b/platform/editor/shared/intellij.platform.editor.iml index 098b18bdbc4b..019464327ff4 100644 --- a/platform/editor/shared/intellij.platform.editor.iml +++ b/platform/editor/shared/intellij.platform.editor.iml @@ -13,5 +13,6 @@ + \ No newline at end of file diff --git a/platform/editor/shared/src/EditorEntityTypeProvider.kt b/platform/editor/shared/src/EditorEntityTypeProvider.kt index eca699fc2465..f0968f06034a 100644 --- a/platform/editor/shared/src/EditorEntityTypeProvider.kt +++ b/platform/editor/shared/src/EditorEntityTypeProvider.kt @@ -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 diff --git a/platform/kernel/pasta/api-dump.txt b/platform/kernel/pasta/api-dump.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/kernel/pasta/intellij.platform.pasta.iml b/platform/kernel/pasta/intellij.platform.pasta.iml new file mode 100644 index 000000000000..19351bb93137 --- /dev/null +++ b/platform/kernel/pasta/intellij.platform.pasta.iml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + $KOTLIN_BUNDLED$/lib/kotlinx-serialization-compiler-plugin.jar + $MAVEN_REPOSITORY$/jetbrains/fleet/rhizomedb-compiler-plugin/2.1.10-0.1/rhizomedb-compiler-plugin-2.1.10-0.1.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/platform/kernel/shared/src/editor/pasta/common/AnchorStorageComponent.kt b/platform/kernel/pasta/src/common/AnchorStorageComponent.kt similarity index 92% rename from platform/kernel/shared/src/editor/pasta/common/AnchorStorageComponent.kt rename to platform/kernel/pasta/src/common/AnchorStorageComponent.kt index 39dfe2059637..3c8829e595e0 100644 --- a/platform/kernel/shared/src/editor/pasta/common/AnchorStorageComponent.kt +++ b/platform/kernel/pasta/src/common/AnchorStorageComponent.kt @@ -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 diff --git a/platform/kernel/shared/src/editor/pasta/common/DbMutableDocument.kt b/platform/kernel/pasta/src/common/DbMutableDocument.kt similarity index 81% rename from platform/kernel/shared/src/editor/pasta/common/DbMutableDocument.kt rename to platform/kernel/pasta/src/common/DbMutableDocument.kt index ef2b0d0973f4..164f4cc9e45b 100644 --- a/platform/kernel/shared/src/editor/pasta/common/DbMutableDocument.kt +++ b/platform/kernel/pasta/src/common/DbMutableDocument.kt @@ -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() - 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) { 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 } } } diff --git a/platform/kernel/shared/src/editor/pasta/common/DocumentChange.kt b/platform/kernel/pasta/src/common/DocumentChange.kt similarity index 93% rename from platform/kernel/shared/src/editor/pasta/common/DocumentChange.kt rename to platform/kernel/pasta/src/common/DocumentChange.kt index 3a7352416243..c6eba2e98b63 100644 --- a/platform/kernel/shared/src/editor/pasta/common/DocumentChange.kt +++ b/platform/kernel/pasta/src/common/DocumentChange.kt @@ -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), ), ) diff --git a/platform/kernel/shared/src/editor/pasta/common/DocumentComponentEntity.kt b/platform/kernel/pasta/src/common/DocumentComponentEntity.kt similarity index 94% rename from platform/kernel/shared/src/editor/pasta/common/DocumentComponentEntity.kt rename to platform/kernel/pasta/src/common/DocumentComponentEntity.kt index 2d769527e809..7cddf88a8081 100644 --- a/platform/kernel/shared/src/editor/pasta/common/DocumentComponentEntity.kt +++ b/platform/kernel/pasta/src/common/DocumentComponentEntity.kt @@ -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 diff --git a/platform/kernel/shared/src/editor/pasta/common/DocumentEntity.kt b/platform/kernel/pasta/src/common/DocumentEntity.kt similarity index 98% rename from platform/kernel/shared/src/editor/pasta/common/DocumentEntity.kt rename to platform/kernel/pasta/src/common/DocumentEntity.kt index 30eef10978bd..034fe260e71b 100644 --- a/platform/kernel/shared/src/editor/pasta/common/DocumentEntity.kt +++ b/platform/kernel/pasta/src/common/DocumentEntity.kt @@ -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 diff --git a/platform/kernel/shared/src/editor/pasta/common/EditLogEntity.kt b/platform/kernel/pasta/src/common/EditLogEntity.kt similarity index 94% rename from platform/kernel/shared/src/editor/pasta/common/EditLogEntity.kt rename to platform/kernel/pasta/src/common/EditLogEntity.kt index 7ac7a51ed3c8..8f01b64bf028 100644 --- a/platform/kernel/shared/src/editor/pasta/common/EditLogEntity.kt +++ b/platform/kernel/pasta/src/common/EditLogEntity.kt @@ -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 diff --git a/platform/kernel/shared/src/editor/pasta/common/LocalAnchor.kt b/platform/kernel/pasta/src/common/LocalAnchor.kt similarity index 88% rename from platform/kernel/shared/src/editor/pasta/common/LocalAnchor.kt rename to platform/kernel/pasta/src/common/LocalAnchor.kt index 14166456c603..191c2412e0d5 100644 --- a/platform/kernel/shared/src/editor/pasta/common/LocalAnchor.kt +++ b/platform/kernel/pasta/src/common/LocalAnchor.kt @@ -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 { diff --git a/platform/kernel/shared/src/editor/pasta/common/LocalAnchorStorageEntity.kt b/platform/kernel/pasta/src/common/LocalAnchorStorageEntity.kt similarity index 98% rename from platform/kernel/shared/src/editor/pasta/common/LocalAnchorStorageEntity.kt rename to platform/kernel/pasta/src/common/LocalAnchorStorageEntity.kt index 8d039681e203..4f1b730685a1 100644 --- a/platform/kernel/shared/src/editor/pasta/common/LocalAnchorStorageEntity.kt +++ b/platform/kernel/pasta/src/common/LocalAnchorStorageEntity.kt @@ -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 diff --git a/platform/kernel/shared/src/editor/pasta/common/LocalRangeMarker.kt b/platform/kernel/pasta/src/common/LocalRangeMarker.kt similarity index 97% rename from platform/kernel/shared/src/editor/pasta/common/LocalRangeMarker.kt rename to platform/kernel/pasta/src/common/LocalRangeMarker.kt index ea615428803c..4a778a865fc2 100644 --- a/platform/kernel/shared/src/editor/pasta/common/LocalRangeMarker.kt +++ b/platform/kernel/pasta/src/common/LocalRangeMarker.kt @@ -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 diff --git a/platform/kernel/shared/src/editor/pasta/common/SharedDocumentInstructions.kt b/platform/kernel/pasta/src/common/SharedDocumentInstructions.kt similarity index 95% rename from platform/kernel/shared/src/editor/pasta/common/SharedDocumentInstructions.kt rename to platform/kernel/pasta/src/common/SharedDocumentInstructions.kt index 38ce2fefcb21..6e3c722b0ec9 100644 --- a/platform/kernel/shared/src/editor/pasta/common/SharedDocumentInstructions.kt +++ b/platform/kernel/pasta/src/common/SharedDocumentInstructions.kt @@ -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 diff --git a/platform/kernel/shared/src/editor/pasta/common/UnsharedHack.kt b/platform/kernel/pasta/src/common/UnsharedHack.kt similarity index 92% rename from platform/kernel/shared/src/editor/pasta/common/UnsharedHack.kt rename to platform/kernel/pasta/src/common/UnsharedHack.kt index 8172a3470e92..ccb27b5bb009 100644 --- a/platform/kernel/shared/src/editor/pasta/common/UnsharedHack.kt +++ b/platform/kernel/pasta/src/common/UnsharedHack.kt @@ -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 diff --git a/platform/kernel/shared/src/editor/pasta/common/package-info.java b/platform/kernel/pasta/src/common/package-info.java similarity index 78% rename from platform/kernel/shared/src/editor/pasta/common/package-info.java rename to platform/kernel/pasta/src/common/package-info.java index d3038847ee9e..fc56b1252857 100644 --- a/platform/kernel/shared/src/editor/pasta/common/package-info.java +++ b/platform/kernel/pasta/src/common/package-info.java @@ -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; diff --git a/platform/kernel/shared/intellij.platform.kernel.iml b/platform/kernel/shared/intellij.platform.kernel.iml index 67c8d07279a5..f37d90ebd9b0 100644 --- a/platform/kernel/shared/intellij.platform.kernel.iml +++ b/platform/kernel/shared/intellij.platform.kernel.iml @@ -15,7 +15,6 @@ - $KOTLIN_BUNDLED$/lib/kotlinx-serialization-compiler-plugin.jar $MAVEN_REPOSITORY$/jetbrains/fleet/rhizomedb-compiler-plugin/2.1.10-0.1/rhizomedb-compiler-plugin-2.1.10-0.1.jar @@ -36,7 +35,6 @@ - @@ -45,5 +43,6 @@ + \ No newline at end of file diff --git a/platform/kernel/shared/src/util/kernelUtils.kt b/platform/kernel/shared/src/util/kernelUtils.kt index 1f3e8cbb395e..4d0cf580577f 100644 --- a/platform/kernel/shared/src/util/kernelUtils.kt +++ b/platform/kernel/shared/src/util/kernelUtils.kt @@ -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.* diff --git a/platform/platform-impl/bootstrap/kernel/intellij.platform.ide.bootstrap.kernel.iml b/platform/platform-impl/bootstrap/kernel/intellij.platform.ide.bootstrap.kernel.iml index 6bf75945bf07..1644c9c3d688 100644 --- a/platform/platform-impl/bootstrap/kernel/intellij.platform.ide.bootstrap.kernel.iml +++ b/platform/platform-impl/bootstrap/kernel/intellij.platform.ide.bootstrap.kernel.iml @@ -13,5 +13,6 @@ + \ No newline at end of file diff --git a/platform/platform-impl/bootstrap/kernel/src/com/intellij/platform/ide/bootstrap/kernel/kernel.kt b/platform/platform-impl/bootstrap/kernel/src/com/intellij/platform/ide/bootstrap/kernel/kernel.kt index 87640033e0a2..363b0f512e17 100644 --- a/platform/platform-impl/bootstrap/kernel/src/com/intellij/platform/ide/bootstrap/kernel/kernel.kt +++ b/platform/platform-impl/bootstrap/kernel/src/com/intellij/platform/ide/bootstrap/kernel/kernel.kt @@ -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 diff --git a/platform/platform-impl/intellij.platform.ide.impl.iml b/platform/platform-impl/intellij.platform.ide.impl.iml index f47b053a6e21..78c02edf8c73 100644 --- a/platform/platform-impl/intellij.platform.ide.impl.iml +++ b/platform/platform-impl/intellij.platform.ide.impl.iml @@ -150,5 +150,6 @@ + \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/ad/v2/AdDocumentV2.kt b/platform/platform-impl/src/com/intellij/openapi/editor/impl/ad/v2/AdDocumentV2.kt index 1d2057faf0c3..e22b75d7bcc7 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/ad/v2/AdDocumentV2.kt +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/ad/v2/AdDocumentV2.kt @@ -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 diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/ad/v2/AdTheManagerV2.kt b/platform/platform-impl/src/com/intellij/openapi/editor/impl/ad/v2/AdTheManagerV2.kt index 2c93bbb92d39..bc8861ab4e8a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/ad/v2/AdTheManagerV2.kt +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/ad/v2/AdTheManagerV2.kt @@ -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