Commit Graph

681 Commits

Author SHA1 Message Date
Kirill Bochkarev
5f38ba337c [IJPL-166430] Refactor com.intellij.openapi.module.ModuleUtilCore#collectModulesDependsOn
introduce WorkspaceModelLegacyBridge; collectModulesDependsOn via WSM edition

Merge-request: IJ-MR-148336
Merged-by: Kirill Bochkarev <podockonnik@gmail.com>

(cherry picked from commit fab2218a8b90eac677c3c9408af4319a842cf3fb)

IJ-CR-149781

GitOrigin-RevId: ee7277e9ddb6587d445ca7029ba4f89eb905ee86
2024-11-22 22:52:28 +00:00
Kirill Bochkarev
c010774a56 RIDER-90456 check root dir sensitivity when creating wsm
(cherry picked from commit 29df6ca6ae69a9e5c38625fd9d9317ce5521a5f4)

IJ-MR-146692

GitOrigin-RevId: cd88ea6cf6b3c698a4daa7626eba613a865d9e9f
2024-10-15 21:41:59 +00:00
Daniil Ovchinnikov
5db74b516f IJPL-453 migrate from OnlyThrowLoggedErrorProcessor to assertErrorLogged
GitOrigin-RevId: cf789d36a8f09c7fd562c42584c2e1fc2f4a1792
2024-10-05 19:46:55 +00:00
Vladimir Koshelev
b4921470f5 [PY-76337] disable plugins with use-idea-classloader if appcds is enable
GitOrigin-RevId: 6097121559ae18571cad8ee239fe8dda9e085f85
2024-10-01 10:23:30 +00:00
Andrei.Kuznetsov
10af260912 IJPL-157852,IJPL-16008: Introduce registry option ide.workspace.model.write.external.files.immediately
When enabled, WSM writes module xml files immediately when the file content is available (needs less heap because all the intermediate objects will be collected sooner). When disabled (legacy behavior) WSM will collect all the contents of all the files for each changed module, and then flush all the data in a separate pass (needs more heap to keep all the intermediate objects).

GitOrigin-RevId: 4c3756a21f7d1b24fecb798a71d56cd837ba58e1
2024-09-30 21:49:39 +00:00
Andrei.Kuznetsov
7858234b0c IJPL-157852,IJPL-16008: Introduce JpsFileContentWriter2 which can write (iml/xml) file as a whole
GitOrigin-RevId: 5f84b7657b1e2846b4ada9a2cbf102501267e228
2024-09-30 21:49:39 +00:00
Andrei.Kuznetsov
e2da1c70b0 IJPL-157852,IJPL-16008: Cleanup: get rid of JpsFileContent#asReader WritableJpsFileContent#asWriter
Because they look ugly and break encapsulation

GitOrigin-RevId: f526ffcfde863172d89f6d4a100136964561dedf
2024-09-30 21:49:39 +00:00
Andrei.Kuznetsov
4f1289fa80 IJPL-157852,IJPL-16008: Refactoring: Introduce WriteableJpsFileContent (JpsFileContentWriter bound to specific file)
GitOrigin-RevId: c6d6362616951e49a46df6a82a7f2a02ad377294
2024-09-30 21:49:38 +00:00
Vladimir Krivosheev
bd0ab93581 IJPL-163178 fix "Accessing disposed message bus MessageBus" (part 2)
GitOrigin-RevId: 5214f7dcedce61e746cb1d52cb8912ee8e3ef2b9
2024-09-30 08:52:33 +00:00
Andrei.Kuznetsov
366f9dcc27 IJPL-157852,IJPL-16008: introduce ide.workspace.model.write.external.files.directly registry option
When enabled, WSM bypasses module's configuration stores on project save and writes module xml files directly to 'cache' directory (iml files are still saved through module's configuration stores)

GitOrigin-RevId: de34f4534b62ebb5bba957651c36e49d9d9bbf3c
2024-09-27 14:53:42 +00:00
Vladimir Krivosheev
a9e7930abe bazel - build lang-impl
GitOrigin-RevId: c4c4dce20bd6e4046644f95f6e7b3f437c51668d
2024-09-27 13:47:17 +00:00
Daniil Ovchinnikov
f35d2c1c62 IJPL-453 add and use the ability to re-throw logged errors in particular tests
GitOrigin-RevId: 9707406b5a2290b81e28cb1f64bf4d3891f757ef
2024-09-25 19:42:36 +00:00
Andrei.Kuznetsov
dea29ffd9c IJPL-157852: Unify modules loading with isExternalStorageEnabled enabled and disabled
GitOrigin-RevId: 72ad641be9dac91fee970c5393ca4001576fff08
2024-09-25 19:12:31 +00:00
Andrei.Kuznetsov
ffbce8da16 IJPL-157852: Let JpsFileContent hold parsed file content, not just delegate to a reader
The goal is to take full control over iml parsing. Namely:
0. From WSM's point of view, iml/xml files are plain xml files that describe a project, not a component store. There are no components in WSM, there are entities. Partitioning (accessing components by names) is not really helpful here.
1. Get full access to iml/xml file content: soon we'll need a method like `getAllComponents`. Introducing this method to JpsFileContentReader does not look right because this would mean that some code might try parsing the whole config file, instead of querying its own piece of configuration.
2. Do not keep parsed iml files in the memory longer than needed (JpsFileContentReader may hold cached content longer than actually needed).

GitOrigin-RevId: 7461e6a1a0fa539feb025f6f626f224df56be230
2024-09-25 19:12:31 +00:00
Andrei.Kuznetsov
bdcf64cb72 IJPL-157852: Refactoring: Extract duplicated code into a separate object (DefaultImlNormalizer)
Extract duplicated code (which converts module attributes to DeprecatedModuleOptionManager component) into a separate object DefaultImlNormalizer

GitOrigin-RevId: 2ba0939a57331cdeb6c9e8395c962cab1314b30a
2024-09-25 19:12:31 +00:00
Andrei.Kuznetsov
6cebd65898 IJPL-157852: Refactoring: Introduce JpsFileContent (JpsFileContentReader bound to specific file)
This is to improve control over which files are being accessed in ModuleImlFileEntitiesSerializer, and to make it more clear which file (iml or xml) is read in different places

GitOrigin-RevId: 7b11b8caf0acb9ed3eb60e8518360e17d3a0af5f
2024-09-25 19:12:31 +00:00
Andrei.Kuznetsov
5fe87dd852 IJPL-157852: Refactoring: FacetsSerializer should not know anything about components and iml file structure
GitOrigin-RevId: f501e7e8b448a011cfd24e11ebe3d820191b570b
2024-09-25 19:12:31 +00:00
Andrei.Kuznetsov
86eba479c2 IJPL-157852: Refactoring: make ModuleImlFileEntitiesSerializer.createFacetSerializer private
GitOrigin-RevId: ba12ad45f3be9cdd30892314321b10b4789bf017
2024-09-25 19:12:31 +00:00
Andrei.Kuznetsov
e7b290710f IJPL-157852: CustomModuleComponentSerializer should not know anything about components and iml file structure
GitOrigin-RevId: 61b8964d965af37ad51e91b2681a71ada8c49a31
2024-09-25 19:12:31 +00:00
Vladimir Krivosheev
a1210118c0 bazel - fix JPMS, exports and internal
GitOrigin-RevId: 3dc80a9ee01e1900c0cebc24b2d08f04f93ddeff
2024-09-25 19:05:37 +00:00
Vladimir Krivosheev
4eb9b78b78 use bazel to build platform-impl
GitOrigin-RevId: b5bbc75323a08c7674777e512dcfd988ceb4461f
2024-09-22 17:01:28 +00:00
Vladimir Krivosheev
834bd75254 run jps-to-bazel by Bazel, compile platform using Bazel
GitOrigin-RevId: 3774d5adc404b02036f70b7cc35c9e60fdb5d84c
2024-09-21 00:54:17 +00:00
Lev Leontev
393308afd6 Revert "[vfs] BAZEL-1041: avoid calls to UnixPath.toRealPath in WorkspaceModelImpl.replaceProjectModel"
This reverts commit 4769be486102e3026c3002a219b4fad6a107dfe7.

GitOrigin-RevId: ea8dd1525d64f497de2823a32d3bd8d70529a2b9
2024-09-20 15:26:16 +00:00
Lev Leontev
677be42ef1 Revert "[vfs] BAZEL-1041: add test for WorkspaceModelInternal#getCanonicallyCasedVirtualFileUrlManager"
This reverts commit bb14c11c07cb2b2ec5761361581e5d6e3ee1b6f1.

GitOrigin-RevId: fade30d449dd2d6d579854935e5b53801c38f07e
2024-09-20 15:26:16 +00:00
Vladimir Krivosheev
8455df53ca build build-scripts using Bazel
GitOrigin-RevId: f6ab74d791f866f567297e20266a7620cddfafae
2024-09-20 01:52:02 +00:00
Lev Leontev
5509994a0e [vfs] BAZEL-1041: add test for WorkspaceModelInternal#getCanonicallyCasedVirtualFileUrlManager
GitOrigin-RevId: bb14c11c07cb2b2ec5761361581e5d6e3ee1b6f1
2024-09-18 20:57:32 +00:00
Lev Leontev
6927db41ac [vfs] BAZEL-1041: avoid calls to UnixPath.toRealPath in WorkspaceModelImpl.replaceProjectModel
GitOrigin-RevId: 4769be486102e3026c3002a219b4fad6a107dfe7
2024-09-17 20:09:24 +00:00
Roman Golyshev
eefc6bb21f [Workspace Model][IJPL-161667] Replace put with putIsAbsent in ImmutableEntityStorageImpl.initializeEntity
It does not make sense to replace a value in `entityCache`
if it was concurrently inserted by someone else.

GitOrigin-RevId: f28ff2357ced479942bef3c05483d5106a757d34
2024-09-05 23:14:34 +00:00
Roman Golyshev
e517d0e1e8 [Workspace Model][IJPL-161667] Use ConcurrentLongObjectMap as cache in ImmutableEntityStorageImpl.initializeEntity
This makes the explicit synchronization unnecessary.

In the past, using `ConcurrentLongObjectMap` here led
to performance degradations (see IJPL-14861).

Now performance tests seem to indicate that there is no performance degradation
related to `ConcurrentLongObjectMap` anymore - presumably after a significant update
made to it in ite2c9a0a59.

^IJPL-161667 Fixed

GitOrigin-RevId: f1be39475667cd48de62c1b85c6cef611128fa7d
2024-09-05 23:14:34 +00:00
Mikhail Filippov
f13d92e82f IJPL-150165 switch to invoke dynamic lambdas in Kotlin
GitOrigin-RevId: 63ba45a21874cc723917982996fce1a510b2a182
2024-09-05 11:19:31 +00:00
Edem Ibraimov
bb4ea4e545 CPP-40400: WorkspaceBuilderChangeLog: use persistent collections instead of immutable
GitOrigin-RevId: 5d8c98a6b165f8336c0126970a4fdc259430bc59
2024-09-01 08:50:06 +00:00
Edem Ibraimov
c228ac9115 CPP-40400: WorkspaceBuilderChangeLog: update references directly without 'contains' checks
GitOrigin-RevId: ebe28750d124f1971ec2d747b7a2dc803d6c7cdd
2024-09-01 08:50:06 +00:00
Edem Ibraimov
0c6df29d9c CPP-40400: WorkspaceBuilderChangeLog: add default parameters for References class
GitOrigin-RevId: 2c821536d746bdbcdbc5f82588e087962f4adbef
2024-09-01 08:50:06 +00:00
Mikhail Filippov
bf43f2fc01 IJPL-150165 bump Kotlin language and API version
GitOrigin-RevId: a59dc8ca214a5047773fccf1cf28a1e1b07acf68
2024-08-30 22:15:55 +00:00
Alex Plate
7f1b92aeff [Workspace Model] [IJPL-161113] Extract LegacyBridgeJpsEntitySourceFactory
GitOrigin-RevId: e63b268499dcca0736144618ff891eca93b3f92d
2024-08-27 16:19:06 +00:00
Alex Plate
f093067ae0 [Workspace Model] [IJPL-161113] Extract createEntitySourceForArtifact into the separate service
GitOrigin-RevId: 58c2a87fdd325a95c738117e97468de38e090605
2024-08-27 16:19:06 +00:00
Lev Leontev
18092b9757 [workspace model] IJPL-894 Check the registry key only once per IDE launch for performance
GitOrigin-RevId: d7cf8f4554defb046e93bc117cc3a803a8a2852e
2024-08-26 13:25:34 +00:00
Nikolay Chashnikov
35a9f9cbc7 [jps model] make JpsLibraryCollectionBridge a real JpsElement (IJPL-409)
We have code that invokes `jpsLibrary.getParent().getParent()` to get a JpsModule instance for a module-level library. To keep such code working, we need to have JpsModule and JpsProject as super-parents (not direct parents) of JpsLibrary instances in the new implementation as well.

GitOrigin-RevId: a5f944d152229275b05efdfc686afa091c3fd963
2024-08-14 17:15:46 +00:00
Vladimir Krivosheev
1ed0c32b06 IJPL-159596 prefer SynchronizedClearableLazy
GitOrigin-RevId: 0409e7a776832a4f30e02106edc390dbddd8bf52
2024-08-06 19:58:37 +00:00
Alex Plate
0b7a37f9a9 [Workspace Model] Add tests for the removeSingleEntity function
This test was not added when the flags for changelog were introduced

This is related to IJPL-156456
Related review: https://code.jetbrains.team/p/ij/repositories/ultimate/reviews/140940

GitOrigin-RevId: bc57821703756f448b552032eb81bef3c97531ae
2024-08-01 11:52:53 +00:00
Mikhail Mazurkevich
9eb9998e3b [workspace model] IJPL-894 Detect bridge usage from inappropriate places in listeners
GitOrigin-RevId: 617f16ef5eacfee1d4a968507c62cf315fd802c7
2024-07-30 10:58:46 +00:00
Mikhail Mazurkevich
a055f48a2a [workspace devkit] IJPL-158678 Regenerate entities
GitOrigin-RevId: fb92456f98b6e7c7c0bf327405a7fa003a67c8b2
2024-07-24 20:23:44 +00:00
Alex Plate
d39400e551 [Workspace Model] [IJPL-158993] Do not update symbolic indexes when no changes on entity are made
Indexes update may take some time, but there is no need to do it if there are no changes in the entity.

GitOrigin-RevId: cafacff194d6837fbd5d004ca1da81c819c42ed1
2024-07-24 12:15:07 +00:00
Alex Plate
4f191cc33c [Workspace Model] Improve entity id printing in logging
GitOrigin-RevId: 6121ea38b4a189a8474ab89ba1424bb6cd6814c4
2024-07-24 12:15:07 +00:00
Nikita Kudrin
cdf91bf213 [benchmarks] Renaming PerformanceTest* => Benchmark*
GitOrigin-RevId: 9963b84d51e1062acc262a8d3d3de1409a708e3b
2024-07-23 18:20:01 +00:00
Alex Plate
2a881c2835 [Workspace Model] Add more trace logging on entity removing
This is related to IJPL-158251

GitOrigin-RevId: ceb8bb591cc1a09fa14dccb3247e4a2a4e2e6bcc
2024-07-23 15:21:00 +00:00
Mikhail Mazurkevich
1ddfba7249 Revert "[workspace model] IDEA-356368 Add more logging"
This reverts commit 1d98a64f

GitOrigin-RevId: 6851dcf24e56b4f2875bd119219e30634b03d88c
2024-07-23 08:42:13 +00:00
Nikolay Chashnikov
14c1c5ec10 [jps build] use relative paths when loading the workspace model from cache if and only if IDE uses relative paths (IJPL-157801)
StorageSerializerUtil.getVirtualFileUrlSerializer stores VirtualFileUrl instance in completely different format if 'ide.workspace.model.store.relative.paths.in.cache' registry option is enabled. Deserialization in the build process must use the same format as the IDE, so now value of this registry options is passed as 'ide.workspace.model.store.relative.paths.in.cache' system property to the JPS build process and used there to switch relativization on or off.

GitOrigin-RevId: a87b7f4f1a2c073a8d1fdaaa72a38b5dc11d0e01
2024-07-22 18:59:54 +00:00
Nikolay Chashnikov
b0b40d867a [workspace model] register implementations of VirtualFileUrl in the cache without mentioning their classes (IJPL-409)
We have a custom serializer for `VirtualFileUrl` which is used for its implementations. In the IDE process we use `VirtualFileUrlBridge` implementation for all instances, and in the JPS build process this class is not available, and `VirtualFileUrlImpl` is used instead. To avoid mentioning the specific class name in the cache, `VirtualFileUrlManagerImpl` now exposes the implementation class via `virtualFileUrlImplementationClass`, which is registered in Kryo.

This also speeds up serialization a bit since we don't need to iterate over all instances of VirtualFileUrl in the storage.

GitOrigin-RevId: 7366f37cbc7a1575bbc97aba0b45eb4d547974a3
2024-07-22 18:59:54 +00:00
Alex Plate
70fd15a2a5 [Workspace Model] Remove duplicated test
GitOrigin-RevId: 0f10e230c84759c289d9e8cbf0b8485c2d23bb0a
2024-07-22 18:55:01 +00:00