Commit Graph

3284 Commits

Author SHA1 Message Date
Bart van Helvert
fa5311aa0d [jps] Migrate pre/post compile FUS to structured IDE activity API
#IDEA-344147

GitOrigin-RevId: c3270d04bf16f8adba2d9a056271a1ad79ac2caa
2024-03-13 10:27:23 +00:00
Vladimir Lagunov
8b29442f76 Add blockingContext to c.i.compiler.backwardRefs.IsUpToDateCheckStartupActivity.execute
Correct progress indicators/jobs are required by `WSLDistribution` now.

GitOrigin-RevId: d9a861ff1957d4705afa308c3c9008b034701f4d
2024-03-12 16:11:07 +00:00
Vladimir Krivosheev
bda1f6fc29 cleanup - isEmpty
GitOrigin-RevId: c17e6a4e6d9286f2a6e19c536aa94f1d3f0a890e
2024-03-11 02:16:14 +00:00
Vladimir Krivosheev
72efd72cf0 reduce the usage of kotlinx-immutable-collections
GitOrigin-RevId: f5a8cc34ffff305e2793ea2a109156dcde4014b0
2024-03-11 02:16:11 +00:00
Bart van Helvert
10f58f919d [jps] Collect time spend in pre-compile tasks in FUS
#IDEA-344147

GitOrigin-RevId: e2b6fa748c0f4dc7db61fd649c8005efe5ccbd75
2024-03-07 22:15:34 +00:00
Mikhail Mazurkevich
22045ae723 [workspace model ]IJPL-345 Rename getOrCreateFromUri to getOrCreateFromUrl
GitOrigin-RevId: 0df377f4450b6db2c907524f1a99a451fd93e039
2024-02-27 10:44:13 +00:00
Eugene Zhuravlev
d87381311a Revert "in test mode make sure the command queue is drained before service disposal (IDEA-340414)"
This reverts commit 85807a31e4ab792f95c1d92d5a096aae02f8ad32.

GitOrigin-RevId: c86c6b76a2729d26494bd40e04cdc2aa73f53d94
2024-02-22 01:17:21 +00:00
Eugene Zhuravlev
bc423766d1 in test mode make sure the command queue is drained before service disposal (IDEA-340414)
GitOrigin-RevId: 52f85bce04eef57e742cbdf38de41e6e1219479c
2024-02-22 01:17:16 +00:00
Alex Plate
f5a44b1a11 [Workspace Model] [IDEA-336944] More use of the reactive read
GitOrigin-RevId: 57543d6f3069baded71e23691b946a56de1cfb9e
2024-02-16 14:39:31 +00:00
Vladimir Lagunov
56245fabfb Cleanup BuildManager: don't use Project as a Disposable parent
GitOrigin-RevId: de054d644fbb90af977f4d77f6f42957c303a246
2024-02-15 20:00:57 +00:00
Vladimir Lagunov
00650513b7 IDEA-344395 Provide ProgressIndicator in BuildManager.BuildManagerStartupActivity.runActivity
A progress indicator is important for calling old Java-based API which falls into WSL+Ijent. Without the progress indicator, the function may freeze for unpredictable time.

GitOrigin-RevId: 04a063c555391ee12295882b9a713082aa38fefa
2024-02-15 20:00:57 +00:00
Vladimir Krivosheev
0bdd610d3e cleanup
GitOrigin-RevId: 0049353c9aafac765c141504c25e548d9d7f7c35
2024-02-13 16:26:22 +00:00
Alex Plate
209f9cd83f [Workspace Model] [IDEA-336944] Implement reactive read for workspace model
GitOrigin-RevId: 11646f30d0e44751c68f8f4dd6d32d4b399d6dfe
2024-02-13 15:37:24 +00:00
Dmitry Batkovich
86315becb8 optimize produced garbage in ArtifactBridge IDEA-345621
GitOrigin-RevId: 636b8014c2a33ec79518bb144588549ab0c7fdbe
2024-02-11 12:13:04 +00:00
Dmitry Batkovich
c83d01a78c produce less garbage in ArtifactBridge IDEA-345621
GitOrigin-RevId: 5d3b39093b68d47c92765f55f8513c148baa3da5
2024-02-09 14:42:43 +00:00
Vladimir Krivosheev
11a8751859 use kotlin.io.path.invariantSeparatorsPathString
GitOrigin-RevId: 4ee2eccc21ae3de6c13c1062ef4e80da48c0435b
2024-02-09 06:56:39 +00:00
Vladimir Krivosheev
54d16354c1 do not require building a project to run product in dev mode
GitOrigin-RevId: 1e98741cbd59658c6e45a298ff21dce856f7edfc
2024-02-07 17:03:03 +00:00
Vladimir Krivosheev
2439a2f858 cleanup
GitOrigin-RevId: bd32595c17e0f24ae662d1aaf1aedc8d1f3d8808
2024-02-07 17:02:53 +00:00
Vladimir Krivosheev
f33ba53e27 BuildProcessClasspathManager - resolve in dev mode
GitOrigin-RevId: 5af6a7ed427d290236f60c68e6b682ce4c4f9863
2024-02-07 17:02:30 +00:00
Vladimir Krivosheev
1232573b1b cleanup
GitOrigin-RevId: 730990a5de58ed0077ab55ac501c05360fb559c8
2024-02-07 17:02:27 +00:00
Vladimir Krivosheev
1742d30135 IJPL-594 update fastutil 8.5.11 -> 8.5.13
GitOrigin-RevId: d1668b1b7d439f9d65972d45324f92c3d43f9918
2024-02-07 17:02:20 +00:00
Daniil Ovchinnikov
e0ae0f71e4 IDEA-342556 cancel CoroutineDispatcherBackedExecutor scope during disposal
GitOrigin-RevId: cf9279eb577f961d191cfa85ae9688d39d9e6101
2024-02-07 16:53:01 +00:00
Daniil Ovchinnikov
e40985681d CoroutineDispatcherBackedExecutor is not Executor because it's a resource that needs cleaning up
Either it needs to implement full `ExecutorService`, or be a separate thing.

GitOrigin-RevId: 21ecc2c3718e94e1c3eed32aee31b122aee8a3a1
2024-02-07 16:52:56 +00:00
Nikita Kudrin
e71a6fbe6e [workspace model] IJ-CR-121757 Replace AtomicLong with MillisecondsMeasurer
GitOrigin-RevId: 5ea2d9f80a2f94ecbd4312711505e94e20d3ef6f
2024-02-07 13:23:30 +00:00
Roman Shevchenko
dfb0692f2f [platform] merging component storage utils
GitOrigin-RevId: 40144952ae1cb624a55f4b7e4e3527f24f323028
2024-02-06 20:02:43 +00:00
Nikolay Chashnikov
3acf7e90be [runtime module repository] build runtime module repository during compilation (IDEA-335089)
To ensure that we can change how runtime module descriptors are generated without requiring everybody to update their IDEs, the implementation from module 'intellij.devkit.runtimeModuleRepository.jps' is attached to the build process as a library 'devkit.runtime.module.repository.jps'.

GitOrigin-RevId: 11fb0d872aa5ac8981f026f2bf3077bcebd52af6
2024-01-31 12:16:17 +00:00
Nikolay Chashnikov
25ed897eb5 [java compiler] force FS rescan in JPS build process after changes in excluded directories or patterns (IDEA-344089)
This behavior was broken when BuildManager migrated to listen for events from Workspace Model instead of using rootsChanged. ChangeSourceFileSetTest didn't catch that because BaseCompilerTestCase still used rootsChanged.

GitOrigin-RevId: c5d67bfb423faa723b7b6c355fe07bd01906bd16
2024-01-27 01:41:16 +00:00
Nikolay Chashnikov
a3c630afba [java compiler] subscribe to changes in project model via listeners registered in JavaPlugin.xml
Before it was done inside postStartupActivity, and skipped in tests. The new way may slightly improve performance (the listener won't be loaded until something is actually changed in the workspace model), helps to avoid race conditions (what if project configuration is changed before startup activity finishes?). Also, since the listeners now work in tests as well, we'll be able to get rid of custom logic in tests, and they may start catching bugs like IDEA-344089.

GitOrigin-RevId: 74489f5ea1121fae04aa51920f265ac6fe29e8f7
2024-01-26 12:53:14 +00:00
Nikolay Chashnikov
4503a89436 [java compiler] refactoring: extract BuildManager$WSModelChangeListener to a separate top-level class
This makes BuildManager class a little shorter, and will look better when the listener is registered separately in plugin.xml.

GitOrigin-RevId: 48740b49850813f884ad4a94755c17ec3f5b6a98
2024-01-26 12:53:14 +00:00
Mikhail Mazurkevich
d5911e1ffa [workspace model] IJPL-345 Deregister VirtualFileUrlManager from project/application services
GitOrigin-RevId: 5f042a753c19c199e843a604f6a59ec43542d57d
2024-01-25 08:04:44 +00:00
Mikhail Mazurkevich
690badb9cc [workspace model] IJPL-345 Make VirtualFileUrlManager as a part of WorkspaceModel interface
It'll help us to avoid guessing when we need to use the global or project `VirtualFileUrlManager`

GitOrigin-RevId: 93a8a62634d3b3b284b85c3ca1187403fefc90cc
2024-01-25 08:04:44 +00:00
Vladimir Krivosheev
a920a363f7 IJPL-326 remove getCoroutineScope
GitOrigin-RevId: 071d852d71a7b6a6e5a24088a9bd987fe487f407
2024-01-24 19:51:13 +00:00
Andrei Efanov
06685bed62 refactor(otel): use otel semantic attributes for easy access to docs
GitOrigin-RevId: fc04c1014919ba612b5cce7164cf812b197a43ca
2024-01-23 14:28:30 +00:00
Mikhail Mazurkevich
8101439d4a [workspace model] IJPL-345 Rename VirtualFileUrlManager#fromUrl to VirtualFileUrlManager.getOrCreateFromUri
GitOrigin-RevId: 810c3ce308c902ea4e1acf479a0b781ce45b34bc
2024-01-23 13:44:33 +00:00
Mikhail Mazurkevich
5dc4732274 [workspace model] IJPL-345 Remove VirtualFileUrlManager#fromPath from the API.
Use `VirtualFileUrlManager.fromUrl` instead with direct protocol declaration

GitOrigin-RevId: 470f87104ad2698cbc84e83b38df4624ea04a6f6
2024-01-23 13:44:33 +00:00
Andrey Cherkasov
1a62d88764 Cleanup: use light services
^IDEA-254577

GitOrigin-RevId: 01afb3f2166f8713cd4599f37d43ecf7f4d2944c
2024-01-23 06:03:51 +00:00
Nikolay Chashnikov
a78bfe9d91 [java] report the proper result if JPS build reported errors and was aborted
This restores how it worked before aeb45d9b836 just in case (IJ-CR-123815).

GitOrigin-RevId: 667a371e1de002655b148adc387ffed1d13b4362
2024-01-19 17:23:27 +00:00
Eugene Zhuravlev
736dc78a72 do not fail with NPE if optional performance plugin yourkit extension is not installed
GitOrigin-RevId: 3548014d6eedd35d876d65c4eea09634fa11ab9a
2024-01-16 22:08:00 +00:00
Eugene Zhuravlev
1cebbff03e ensure the returned host ip address always corresponds to the listen address (might be related to IDEA-281198)
GitOrigin-RevId: 0df7328fb349e54463788c2534917c3def6d787a
2024-01-16 16:22:23 +00:00
Vladimir Lagunov
bf0e07845a Expect UnsupportedOperationException from Process.pid() in BuildManager
GitOrigin-RevId: b2ff701f5adb5cde8e48351e316304d815e60d0f
2024-01-12 19:36:43 +00:00
Nikolay Chashnikov
f22de524a1 [java] cleanup: get rid of usage of deprecated API in JpsProjectTaskRunner and simplify code (IJPL-275)
GitOrigin-RevId: aeb45d9b8361f1b8885bf8649146e9b478ee9a45
2024-01-12 16:20:43 +00:00
Vladimir Lagunov
42cb20b032 IDEA-342836 Speed up build on Maven+WSL by using fewer system calls
A common anti-pattern is to check that some file exists before doing any operation with the file. The approach is wrong with two reasons:
* The check for the file existence implies at least one additional system call. System calls are expensive in general and are absurdly expensive for WSL file system.
* The file still may be deleted by an external process after the existence check but before the handling. So, such approach sometimes simply doesn't work as expected.

`java.nio.file.Files.exists` is especially slow on Windows, because it tries to create the file under the hood. See `sun.nio.fs.WindowsFileSystemProvider.checkReadAccess`.

This commit removes the unnecessary `Files.exist`. Instead, the code invokes the intended system calls directly, but the code is ready to catch and handle `FileNotFoundException`.

On my machine, the change helped to reduce the total time of execution of `com.intellij.compiler.server.WslBuildCommandLineBuilder#copyPathToTargetIfRequired` from 129 seconds to 3 seconds.

GitOrigin-RevId: d7093e28c6230bcc3c315b00acaf53f6ee20f28f
2024-01-11 20:35:54 +00:00
Alex Plate
e1e586b158 [Workspace Model] Introduce WorkspaceModelInternal interface with some internal functions
This is a part of IJPL-345

GitOrigin-RevId: c6879d14c8ecbc383b957cfeef2a670743636193
2024-01-11 10:37:33 +00:00
Alex Plate
c97ee189d8 [Workspace Model] Rename addDiff to applyChangesFrom
This name is clearer to understand.

This is a part of IJPL-345

GitOrigin-RevId: 098463d6a956cbd6dfdf2d500b0ee2be50553d26
2024-01-11 10:37:26 +00:00
Alex Plate
2c72660e60 [Workspace Model] Remove entityStorage from the WorkspaceModel API
To get a version of the storage, `currentSnapshot` should be used.

`WorkspaceModelImpl` and `VersionedEntityStorage` are marked as internal. `WorspaceModelImpl` should has an internal modifier, but this is currently not possible because Rider overrides it. `VersionedEntityStorage` may be removed in future at all.

There are some cases when the version of the storage is accessed. Probably we can create a special function to return an entity storage with its version.

This is a part of IJPL-345

GitOrigin-RevId: cc3d6c47099c91c54d571d7ca13c5ef9d84265a9
2024-01-10 15:52:45 +00:00
Alex Plate
8948c9cfe5 [Workspace Model] EntityReference is renamed to EntityPointer
This is a part of IJPL-345

GitOrigin-RevId: 1ebd5ae9908af1f10b1cf2ed857e5c3a17907633
2024-01-10 00:17:42 +00:00
Alexey Kudravtsev
8adf0827c3 followup jetbrains.team/p/ij/reviews/121640
GitOrigin-RevId: 3a712466867fead54d313d4a08cf37c0a65dbade
2024-01-09 18:16:59 +00:00
Gregory.Shrago
fb4856226f IDEA-302128 introduce JBPopupFactory.getPreferredPopupPoint(action, event)
A replacement for deprecated `AnActionButton.getPreferredPopupPoint`.

GitOrigin-RevId: 5f67aee83f986841dace3b3c04081c6c1fa3c368
2024-01-09 00:30:54 +00:00
Alex Plate
cd05a94f85 [Workspace Model] [IJPL-345] Migrate external mapping key from string to an ExternalMappingKey object.
Such objects are also types, so there is no need to specify a type every time the external index is accessed.

GitOrigin-RevId: eba99e669c4d7fe9dcb8bf1a2908d518e1ed4aea
2024-01-04 21:02:47 +00:00
Alex Plate
fd7d93f2f4 [Workspace Model] Use a single string object as a key for external mappings in artifacts
GitOrigin-RevId: 34dabe9a25f0e23407419887607206a03d756017
2024-01-03 11:19:56 +00:00