Commit Graph

591 Commits

Author SHA1 Message Date
Nikolay Chashnikov
5db802c044 [rdct] create a special MigratePluginsFromCustomPlace option and use it to migrate plugins from the IDE to the frontend (RDCT-1393)
When a frontend process starts for the first time on a machine where the corresponding major version of the regular IDE has been already used, we need to migrate some plugins (e.g., keymaps) from the IDE to the frontend. Before it was done using the existing MigrateFromCustomPlace option. However, with such an approach, the whole config directory for the frontend process (which already has some files) is deleted and replaced by the IDE's config directory. And this causes problems, e.g., because it tries to back up and remove the 'process.lock' file. Since we need to migrate only plugins in this case, it's better to have a special config migration option for that. So MigratePluginsFromCustomPlace is introduced, and ConfigImportHelper is changed to run 'migratePlugins' only if this option is used.

This logic will be removed later when the frontend process starts to use the same directory for downloaded plugins as a regular IDE (see RDCT-1738).


(cherry picked from commit e1325d9c9b3866b692a0e20bcdb8cd8e15344ca0)

IJ-CR-147196

GitOrigin-RevId: 632de6d78c8e694dfde0bae87c4bab59d9eeddcd
2024-10-23 10:30:26 +00:00
Vladimir Krivosheev
4a176d4c02 IJ-CR-146078 extract intellij.platform.bootstrap
GitOrigin-RevId: b79efc92829111228e83058e54381d8e02116b6f
2024-10-05 22:01:55 +00:00
Nikolay Chashnikov
247dcce1d5 [remote dev] use a special marker file to indicate that plugins were migrated from the full IDE to the frontend
Before the presence of the plugins directory was used as a marker, but after IDES-6286 is implemented, it may happen that some plugins are installed for the frontend before it starts. In that case the plugins directory will be created, but we still need to migrate the plugins from the local IDE on start. So now a special file frontend-plugins-migrated.txt in the plugins directory is used as a marker.

GitOrigin-RevId: 84e1f9682361256c7a30f6d78f3fa12f6dae465a
2024-10-03 15:15:47 +00:00
Vladimir Krivosheev
a9e7930abe bazel - build lang-impl
GitOrigin-RevId: c4c4dce20bd6e4046644f95f6e7b3f437c51668d
2024-09-27 13:47:17 +00:00
Vladimir Krivosheev
a1210118c0 bazel - fix JPMS, exports and internal
GitOrigin-RevId: 3dc80a9ee01e1900c0cebc24b2d08f04f93ddeff
2024-09-25 19:05:37 +00:00
Vladimir Krivosheev
0a80a2a38e cleanup
GitOrigin-RevId: 7eaa7cbd3abd28e91fc01e7156e1e300f0871f89
2024-09-25 14:15:57 +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
Sergei Tachenov
885b01aa8d IJPL-159968 Move disableLayoutInTextComponents and co to another class
Because it's used in initLux, it's accessed at an early delicate stage.
But UiUtil is a huge class that invokes a lot of stuff in its static init,
and some of that stuff (JBInsets.create) involves scaling, which isn't
initialized here yet.

Invoking preload() from there was a mistake. It's not guaranteed
that all data needed to compute the scaling factors is ready.
And we don't really need it at that stage.

To fix this properly, we extract just the part of UiUtil that's
used in initLux. It isn't even a public API. And as a bonus,
it'll be faster here too, as we don't need to load that huge class
anymore.

GitOrigin-RevId: 6ad6bbb24c7753cfb27f148e405a31117ad74964
2024-09-19 14:14:11 +00:00
Roman Shevchenko
c8ae02f632 [platform] dropping the old Windows instance activation code (IJPL-442 follow-up)
GitOrigin-RevId: 93951ad2df9b83198cba62ad46cf0c976525d338
2024-09-07 13:38:05 +00:00
Nikolay Chashnikov
e9e283d574 [modular loader] refactoring: rename ModuleImportance and its entries for consistency (IJPL-128)
After IJPL-148565 is fixed, we now have ModuleLoadingRule enum for modules included in plugins. Since the meaning of its entries is the same as the meaning of ModuleImportance's entries, the enum and its entries are renamed for consistency. Currently, we cannot reuse RuntimeModuleLoadingRule for plugins to avoid adding dependency from intellij.platform.core.impl to intellij.platform.runtime.product module.

GitOrigin-RevId: c508919804af4a1910c4ee1ce2253228c4164b82
2024-09-06 17:46:32 +00:00
Mikhail Filippov
bf43f2fc01 IJPL-150165 bump Kotlin language and API version
GitOrigin-RevId: a59dc8ca214a5047773fccf1cf28a1e1b07acf68
2024-08-30 22:15:55 +00:00
Nikolay Chashnikov
bd72edd100 [plugin model] support loading plugin content modules from separate JARs in non-bundled plugins (IJPL-161303)
'initMainDescriptorByRaw' function which is used for non-bundled plugins, now searches for content modules under lib/modules first.

PluginBuilder used in tests now allows putting module descriptors to separate JARs. The 'loadDescriptor' function used in tests now takes ZipFilePoolImpl instance instead of NonShareableJavaZipFilePool, because the latter doesn't work with the memory file system used in some tests (Path::toFile call fails).

GitOrigin-RevId: 0276dfd4717f50d97cfa25088b30f2fddf3d1c49
2024-08-30 16:23:46 +00:00
Nikolay Chashnikov
366d2f2ea3 [platform] refactoring: rename ProductMode.LOCAL_IDE to MONOLITH for consistency (RDCT-1417)
GitOrigin-RevId: 145088995b32517ae536e626d8d54dfb31a25331
2024-08-21 08:05:49 +00:00
Sergei Tachenov
10eb79d5de IJPL-159968 Add JreHiDpiUtil.preload to JBUIScale.preload
Similarly to how JBUIScale.systemScaleFactor can be computed
incorrectly and then cached, the same thing can happen to
JreHiDpiUtil.isJreHiDPIEnabled, which in turn will cause
the computation of systemScaleFactor to go wrong
(for example, isJreHiDPIEnabled relies on
SunGraphicsEnvironment.uiScaleEnabled_overridden
which is initialized along with LaF).

Add a similar assert to JBUIScale.preload to check that the value of
JreHiDpiUtil.isJreHiDPIEnabled was not initialized before. Which it
normally shouldn't. Except when it's called from initLux(),
which invokes static initialization of UiUtil, which calls JBUI.scale,
and that causes early init of isJreHiDPIEnabled. For Lux it seems
to be OK, though, just that we have to take that into account,
which is why the new JreHiDpiUtil.preload is allowed to
be called several times, ignoring the subsequent calls,
as to not throw an error if it was preloaded intentionally,
as opposed to an accidental JreHiDpiUtil.isJreHiDPIEnabled
call somewhere.

JreHiDpiUtil.isJreHiDPIEnabled had to be refactored a bit to ensure
that all computations happen inside initialization. No more bypass
for macOS and Wayland. Technically, on macOS we could simply
skip the check in JBUIScale.preloadOnMac, but it's still better
to have it, as detecting early access on macOS, where it's harmless,
could help us to fix it on other platforms, where it isn't.

GitOrigin-RevId: 31989284e85cfd09903f79debdf5858e0c0d0177
2024-08-16 10:03:11 +00:00
Vladimir Koshelev
513cca7ef4 [platform] cleanup ModuleBasedProductLoadingStrategy
GitOrigin-RevId: c0a7bd2c763a2a2f0e716b858ddd8a38edd73ba9
2024-08-09 10:22:42 +00:00
Dmitry Batrak
01a8a0c3e4 GTW-7827 3Set Korean inputs are garbled
update as per review

GitOrigin-RevId: c5f877e43d808fd8995761a1626468110d00a37c
2024-07-30 12:43:58 +00:00
Dmitry Batrak
6787cfc4e6 GTW-7827 3Set Korean inputs are garbled
GitOrigin-RevId: 487c051dc2f312bad8e127f1eb45cd52a2dbc74a
2024-07-30 09:32:36 +00:00
Vladimir Koshelev
6582cf707a [platform] ModuleBasedProductLoadingStrategy: support modules without package prefix
GitOrigin-RevId: 487619cfedb00b8efb1a98890cc8f3b26853521a
2024-07-23 15:59:55 +00:00
Nikolay Chashnikov
7683109180 [rdct] use the proper config and system paths for the frontend process started from PyCharm Community installation (RDCT-1430)
The embedded frontend launcher in PyCharm Community already has the proper pathsSelector, so an attempt to fix it will replace 'PyCharmCE' by 'PyCharmCECE'.

GitOrigin-RevId: dfba27a2316c9934a8b6bfa3025909a88731ffa7
2024-07-04 18:19:42 +00:00
Daniil Ovchinnikov
9f2b32c3c7 rename intellij.platform.devBuildServer -> intellij.platform.buildScripts.devBuildServer
This change excludes this module from the platform.

GitOrigin-RevId: 96e159a092772b0ae9bc3faa224f544281c951f5
2024-06-24 15:32:55 +00:00
Nikolay Chashnikov
bc04a7877c [rdct] use proper paths to settings and caches directories when connecting to Community editions (RDCT-1430)
We use the same distribution of the frontend part for community and ultimate/professional editions of IntelliJ IDEA and PyCharm, and 'idea.path.selector' property is set to the value from the ultimate/professional edition. To use proper value when connecting to a backend from the community edition, we need to adjust it based on the product code specified in the join link in the command line arguments.

GitOrigin-RevId: 663f40075eef089d7a8e36ec0ee2a8ba5f39af10
2024-06-20 18:28:24 +00:00
Nikolay Chashnikov
d7ac809361 [rdct] cleanup: simplify code in FrontendProcessPathCustomizer
Since it's used for the frontend process only, the check for the mode isn't needed anymore. However, we still need to support a 'generic' variant of the frontend which isn't built for a specific IDE and therefore needs to use a  'JetBrainsClient' prefix for directory names.

GitOrigin-RevId: be52b1a8d32c2e63fe6d90a279e93209a07b2f43
2024-06-20 18:28:24 +00:00
Nikolay Chashnikov
a532a0e244 [rdct] refactoring: rename PerProcessPathCustomizer to FrontendProcessPathCustomizer
This is needed for clarity, since we have a separate P3PathCustomizer now. The common code which was reused by P3PathCustomizer is moved to a separate PerProcessPathCustomization class.

GitOrigin-RevId: bee9775ff2f5790239a6c1b55283ffbadb11f39f
2024-06-20 18:28:24 +00:00
alexey.afanasiev
c672589e5e QD-9246 Remove "Qodana" prefix, use "qodana.application" to define if Qodana is in headless run
GitOrigin-RevId: f56172ce17b5c3581df1249876d722716d57da46
2024-06-18 17:04:57 +00:00
Dmitry Batrak
b4e950e883 GTW-8951 Pull Request window has bigger scaling than other interface
Also fixes GTW-8962 (Main window is broken)

GitOrigin-RevId: 8494669cd53abb329311d745bc274e1981a51a22
2024-06-17 19:23:19 +00:00
Roman Shevchenko
75a2117432 [platform] acknowledging the dirty reality of I/O producing exceptions sometimes
GitOrigin-RevId: 7e262eda77247185f877e86783e5adfb35edc21f
2024-06-11 10:12:19 +00:00
Roman Shevchenko
c843eec5bd Cleanup (suppressions; typos; formatting)
GitOrigin-RevId: 0a3bdb418e27c1af79af78536ad5023821401c38
2024-06-10 12:34:56 +00:00
Roman Shevchenko
a81a718d56 [platform] refactoring IDE startup error reporting code (IJPL-358 preparation)
GitOrigin-RevId: ea0b019db9c5369a7258579d890ec7a127879847
2024-06-10 12:34:56 +00:00
Vadim Salavatov
f5ed723e48 IJPL-155958 remove ApiStatus.Internal from kotlin.coroutines.jvm.internal package
GitOrigin-RevId: 8a7fe07ab81fd5631054aaedaa0e1efa52714132
2024-05-31 14:24:15 +00:00
Konstantin Nisht
e95d9319ed IJPL-797 intellij.platform.bootstrap.dev review internal API
GitOrigin-RevId: 956d6f70473e55a8477e7c7de5db65adb92d85d9
2024-05-19 21:45:46 +00:00
Nikolay Chashnikov
b9b0a2f1f7 [rdct] use 'frontend' subdirectory instead of generic 'tmp' subdirectory for temp folders in the frontend process (GTW-2077)
If the frontend process uses the same 'idea.paths.selector' as the monolithic IDE, it's better to put its temporary config and system directories under a special 'frontend' folder. This way they won't be mixed with other per-process folders, and we can be sure that they won't be cleared by the monolithic IDE while the frontend process is running.

GitOrigin-RevId: 5662f7fce327bd5c4d38a829d21d420caee63777
2024-05-15 23:26:42 +00:00
Vladimir Krivosheev
51586a31a1 IJPL-149476 ignore NoSuchFileException
GitOrigin-RevId: 162ee036ed149dd82a1fa4650bbf25d8defc1bad
2024-05-15 21:10:00 +00:00
Vladimir Krivosheev
155813717e IJPL-149476 simplify loadPluginDescriptorsImpl
GitOrigin-RevId: 4c65ac2423950aac96b5dabbf1b79811ef634855
2024-05-15 21:09:30 +00:00
Vladimir Krivosheev
31b8661267 IJPL-149476 extract loadPluginDescriptorsImpl
GitOrigin-RevId: db6d1ffd52ef3587f3cc7c93a52acad4d23d6e8b
2024-05-15 21:09:26 +00:00
Vadim Salavatov
e9fb55c821 IJPL-797 intellij.platform.bootstrap.coroutine review internal API
GitOrigin-RevId: e952315df7add1ae248bc052b1e269c23179fece
2024-05-15 15:10:47 +00:00
Daniil Ovchinnikov
abdcd6d940 IJPL-797 intellij.platform.bootstrap review internal API
GitOrigin-RevId: 9c424d4078bafd27c7586b382882aa1594db13f9
2024-05-15 14:56:44 +00:00
Nikolay Chashnikov
42acfbd38b [platform] ensure that intellij.platform.bootstrap.coroutine comes before kotlin-stdlib in the classpath (IJPL-986)
'intellij.platform.bootstrap.coroutine' module provides a custom variant of DebugProbesKt class from kotlin-stdlib, so it should come first in the classpath to ensure that coroutines dumps work if the IDE or tests are started without packing modules to JARs and without explicitly specified coroutines agent.

GitOrigin-RevId: 2751c8052f3c0285ad109d67daa1d3eb0e7ddb10
2024-05-15 12:05:44 +00:00
Nikolay Chashnikov
fdda4dd520 [rdct] support migration of settings and plugins if the frontend process uses the same config directory as the local IDE (GTW-2077)
If the frontend process uses the same config directory as the corresponding local IDE, there is no need to customize where it imports settings from, the default behavior should work well. However, we still need to store plugins for the local IDE and the frontend variant separately, because not all plugins are compatible with both variants, and we currently cannot determine compatibility while loading plugins. So plugins for the frontend variant are stored in ${idea.plugins.path}/frontend directory.

It isn't enough to migrate plugins from the local IDE to the frontend during migration of the settings. It may happen that the local IDE of this major version was already run on this machine, so when the frontend is started, the config directory will exist and no importing will be performed. To initiate migration of plugins in that case, PerProcessPathCustomizer manually initiates config importing if the plugins directory doesn't exist.
Also, it may happen that the frontend process performs the initial config importing. In that case, it also migrates the plugins for the local IDE from the previous version, because when the local IDE will be started for the first time, the config directory will exist and no importing will be performed.

GitOrigin-RevId: 9dae5c03001b45240e6ae3bbaa56224b522de2f4
2024-05-08 16:17:31 +00:00
Nikolay Chashnikov
bc15ebd252 [rdct] always use per-process config/system directories for the frontend process (GTW-8638)
'JBC_SEPARATE_CONFIG' environment variable and 'rdct.enable.per.connection.client.process' registry options are removed.

GitOrigin-RevId: dba5e66d20d9b076f02c272bacda55f331a7d332
2024-05-06 16:02:36 +00:00
Daniil Ovchinnikov
b03b92e140 IJPL-148490 clean up empty file-classes from existing dumps
GitOrigin-RevId: ca701387e601a76ae25a3a31ca0a02432126e0fb
2024-04-30 20:39:42 +00:00
Egor Ushakov
da7debd54c [kotlin debugger] in coroutines 1.8 creation stacktraces are disabled by default, enable it explicitly for now only in debug mode
GitOrigin-RevId: 2b9b76e629ac52adf4af56484e0fba0e8661f636
2024-04-17 13:00:44 +00:00
Vladimir Krivosheev
567972c35c IJPL-973 extract loadProductModule, move log.debug ModuleBasedProductLoadingStrategy as only this strategy returns null
GitOrigin-RevId: 413e85843ec81d4dea0a0e0e7785a169b1c01094
2024-04-12 07:35:21 +00:00
Nikolay Chashnikov
5ef1ece97e [module-based loader] don't fail startup if product content module cannot be found (CPP-38280)
We use the same root JetBrainsClientPlugin.xml for all IDE-specific frontends, and not all product content modules specified in it are available in all IDEs. E.g., 'intellij.notebooks.ui' isn't present in CLion. Since content modules are optional, absence of some of the in the distribution shouldn't cause an error.

GitOrigin-RevId: 074f93d1a5c31de6d6bf5152d96ba150c72bf7b2
2024-04-09 09:43:58 +00:00
Daniil Ovchinnikov
4369d7df5f IJPL-797 API dump: generate api-dump-unreviewed.txt and exposed API lists [4/4]
GitOrigin-RevId: c48b0b9a6e9596e841dc7928020418b9cd303bcd
2024-04-09 02:21:37 +00:00
Daniil Ovchinnikov
5ec66a02cd IJPL-797 API dump: generate api-dump-unreviewed.txt and exposed API lists [2/4]
GitOrigin-RevId: 1f2fcb6d02f6bf1bb52d4063ac8b13ba953b6697
2024-04-09 02:21:27 +00:00
Vladimir Krivosheev
89503d9d07 IJPL-866 fix Qodana
GitOrigin-RevId: 31ce664b84994c3ee9abf0373274e06225a7cacd
2024-04-03 20:21:19 +00:00
Nikolay Chashnikov
b389067fb7 [module-based loader] fix locating product content modules when the embedded frontend process is started from full IDE (RDCT-1226)
The frontend part of the IDE has its own list of content modules, and at least one of them ('intellij.cwm.guest.notebooks') is not included in lib/modules directory, and it's not simple to put it there, because it's currently part of CWM plugin distribution. So 'findProductContentModuleClassesRoot' is introduced in 'ProductLoadingStrategy', which computes path to the classes root of the module using data from the module repository if the module-based loader is used.

GitOrigin-RevId: dddcb8b16dce64fd73a0cbdde507daaa5b069a10
2024-04-02 15:41:07 +00:00
Kate Botsman
e68cdb6036 RDCT-1200 Fix JetBrains Client doesn't report native crashes
To find and report native crashes `PerformanceWatcherImpl` requires two files: `.pid` and `.appinfo`

These files are stored in the system directory (`PathManager.getSystemPath()`).
For JetBrainsClient we replace default system path (`JetBrains/IntelliJIdea[VERSION]`) with custom per process path (`JetBrains/JetBrainsClient[VERSION]/tmp/per_process_system_0`)

This custom directory is cleaned up on every start therefore `.pid` and `.appinfo` files are also deleted and `PerformanceWatcherImpl` cannot send crash reports.

To fix that, we now keep these files between client restarts.

GitOrigin-RevId: 7c50445d07767cc3a12e36c5511778235e8142b6
2024-03-22 18:25:52 +00:00
Vladimir Krivosheev
c175babc14 IJPL-166 coroutine dump without byte-buddy (final variant #10.1)
GitOrigin-RevId: b203c7d1e4c89087509f5bd697e8b152fc6cc94d
2024-03-20 22:50:15 +00:00