Commit Graph
475140 Commits
Author SHA1 Message Date
Bas Leijdekkers 1416952cc1 Java: update inspection description
GitOrigin-RevId: 8d3e6db7b5e6bc171f243e6aef53b4bd02d69b20
2025-04-15 08:34:10 +00:00
Tagir Valeev 87fcb4eece [java-refactoring] IDEA-360690 Inline method: replace inaccessible field references with getters/setters when available
GitOrigin-RevId: 287af8db31ae356162add06e3564c4052025a026
2025-04-15 07:43:30 +00:00
Pavel Kirpichenkov c94b90dfe8 [Kotlin] fix false positives in the "redundant override" inspection
Cover cases with interface implementation by delegation:
— Do not require two overridden symbols: both the delegate and the
explicit override can refer to the same interface method with a
default implementation.
— Fix subtyping check: delegates override members from the implemented
interface and its supertypes, not subtypes.

KTIJ-16228

GitOrigin-RevId: 93dde1f05141098c359e3e7d4f15a5a63083f44c
2025-04-15 07:41:05 +00:00
Pavel Kirpichenkov 92f5232120 [Kotlin] minor, replace context receiver with regular parameter
KTIJ-16228

GitOrigin-RevId: 8f59fbb55913e43d44e36b2ce8f36da1325f1c43
2025-04-15 07:41:05 +00:00
Pavel Kirpichenkov 8a8b2f3090 [Kotlin] convert the "redundant override" inspection to KotlinApplicableInspectionBase
KTIJ-16228

GitOrigin-RevId: 64604916f4061e55b67966487cfd142e329f4607
2025-04-15 07:41:05 +00:00
Konstantin Hudyakov 9ebf164049 [terminal] IJPL-182482 Increase the terminal FUS group version
GitOrigin-RevId: 3240887ac2a842d28f7baf93185c75a4eaa97df9
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov b82e200355 [terminal] IJPL-182482 Refactor: remove excessive annotations and edit event names
The class is already marked as internal.
No need to mention `terminal` in the event name because it is already a terminal group.

GitOrigin-RevId: 18fce5486c7085977e5fa433628b96c8f8dc1c89
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 5683b193c5 [terminal] IJPL-182482 Add OS version field to the latency events
Not sure how different versions of OS can affect the latency in our case, but who knows, let's see.

GitOrigin-RevId: b53b9ded5e9cfe7def9982b6f47c233dfa8b6535
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 53d80a743b [terminal] IJPL-182482 Report frontend document update latency
Report it with the length of the updated text.

GitOrigin-RevId: e5dc057437abb438e9d8f277e0d25303fad15299
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 4c2516c07b [terminal] IJPL-182482 Report backend document update latency
Report it with the length of the updated text.

GitOrigin-RevId: bb89d8c5ad1d666147b1b431430608f050fccd70
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 320811c078 [terminal] IJPL-182482 Report backend text buffer collection latency
Report it with the length of the collected text.
Also, had to run `TerminalContentChangesTrackerTest` with a project because it now contains FUS logging that requires application even in tests.

GitOrigin-RevId: 74dabd31c4bc28d80ff4cccd5ce9ca1bef32a727
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 1ae8a2eb0d [terminal] IJPL-182482 Reimplement backend typing latency measurement
Pass event time and id to the TerminalStarter. Implement the separate method for that in our override for that.
This way is more explicit and safe because it is not using the global state and matching by event object.

GitOrigin-RevId: ddbf4373bf6226c72bd8db3bc0d8b849d4ba3112
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov f612b74235 [terminal] IJPL-182482 Drop backend typing activity
Backend typing latency measurement will be reimplemented in the next commit.

GitOrigin-RevId: 4c1178a7c02d8740183883dca5b44e2199f27612
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov d3c53e874a [terminal] IJPL-182482 Reimplement frontend typing latency measurement
This approach leverages passing the `initTime` through all key event processing flow.
This way we little bit complicate the implementation, but remove the matching and global state hacks.
Also, this approach is harder to break during refactorings.

GitOrigin-RevId: 587088733902061074604109f6b3e9edfe245136
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 26f1950f43 [terminal] IJPL-182482 Refactor: add id field to all terminal input events
It is just more suitable to have id in all events, not particular ones.

GitOrigin-RevId: d53c7ce7e6558dd4070b63b763af738dc487d205
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov c30ca3b56a [terminal] IJPL-182482 Introduce TimedKeyEvent and use it to pass the information about monotonic time of event init
It will be used to measure the typing latency.
Also, I had to copy the `TerminalEventsHandler` interface to the frontend, because it was necessary to change the parameter types. Previously, we used the interface located in the shared part and common for Gen1 and Gen2.

GitOrigin-RevId: 6b8b0cccde598dc6cef9217232eb3c6725973f9a
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 8579fc51d1 [terminal] IJPL-182482 Drop frontend typing activity
Frontend typing latency measurement will be rewritten in the next commits

GitOrigin-RevId: 87512ce409abc812550b03d2b69552e99cdc3626
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 73dd06d2b9 [terminal] IJPL-182482 Do not report frontend output latency if the terminal is not showing
Not sure that we need to track the latency when the terminal tab is hidden. Only user visible latency is important for us.

GitOrigin-RevId: 7cd859e90fe7494efd041e5c207b7993dd7f53ec
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 569ecdccd0 [terminal] IJPL-182482 Ignore read time during serialization
We need this `readTime` only locally on the backend and put it to the event object only for simplicity.
It is not a good design, but for now there is no suitable alternative. Ideally, we need to have the separate serializable DTO classes hierarchy for RPC.
Or switch to plain longs for measuring the time.

GitOrigin-RevId: f8e20acdfe0d856c73750711d1a14917fc9b5973
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 3868836dd4 [terminal] IJPL-182482 Reimplement the backend output latency measurement
This implementation is more simple:
1. We track the last time of reading from the TTY.
2. We remember the time from step 1 when we text buffer is changed the first time. Here output accumulation session starts.
3. Once output is collected, we put the time from step 2 to the created `TerminalOutputUpdatedEvent` and reset it. Here output accumulation session ends.
4. Once we update the backend models with this event, we report the backend output latency and forward the event to the frontend.

GitOrigin-RevId: ed4e4920b46e5bdd7feb27fa7200e4858b629632
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov 1426c4858b [terminal] IJPL-182482 Drop BackendOutputActivity
Backend output latency measurement will be reimplemented in the next commit

GitOrigin-RevId: 7e541c817486a795268357d01ebcdf8e66597900
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov b4d528a3b0 [terminal] IJPL-182482 Refactor: use TtyListener instead of additional tty connector wrapping
GitOrigin-RevId: 90e3eed07269cb40ee99c2b1f704f16b44b4043a
2025-04-15 07:32:53 +00:00
Konstantin Hudyakov d27e7a6e4e [terminal] IJPL-182482 Report latency in milliseconds instead of microseconds
Microsecond changes are not actionable in our case.

GitOrigin-RevId: 7bc6fa5b8d03eef72172f31a2f39788ac1a512f2
2025-04-15 07:32:53 +00:00
Sergei Tachenov 0d49455fe1 [terminal] IJ-MR-158015 Implement BackendOutputTestFusActivity stub
We don't test FUS in these tests, so an empty implementation will do.

GitOrigin-RevId: fe87779a81b3a14a2b10418f3bae18f8b9d6b505
2025-04-15 07:32:53 +00:00
Sergei Tachenov 2bcd421f86 [terminal] IJ-MR-158015 Clarify EventFlowState thread usage
The initial wording was wrong: it does get called from
the terminal emulator thread sometimes,
on history overflow, when it's not the scrapping coroutine,
but the text buffer itself that initiates buffer collection.

GitOrigin-RevId: 75b99b8040bce96ce6bcb7be04d152ae1a286f80
2025-04-15 07:32:53 +00:00
Sergei Tachenov dc39c87f5f [terminal] IJ-MR-158015 Refactor FusAwareTtyBasedDataStream
Use delegation instead of inheritance. Make the class private.

GitOrigin-RevId: 249caf3ac6ab166dd715e172692477f81949ebd5
2025-04-15 07:32:53 +00:00
Sergei Tachenov daef3c9e81 [terminal] IJ-MR-158015 Refactor: extract FusAwareTtyConnector
Use delegation instead of inheritance.

GitOrigin-RevId: cf3b94e624396593bb5cad0e3d6d5d25d35970e5
2025-04-15 07:32:53 +00:00
Sergei Tachenov 9f6e1bd228 [terminal] IJ-MR-158015 Refactor: extract FrontendLatencyService
Now most of this complicated logic is in the frontend module.

GitOrigin-RevId: 26456964aa897bfed073addb6064b973e75f07f6
2025-04-15 07:32:53 +00:00
Sergei Tachenov 0fe5626210 [terminal] IJ-MR-158015 Refactor: extract BackendLatencyService
Now most of this complicated logic is in the backend module.

GitOrigin-RevId: 707b2ae572b93eb3f2f6cdf028648bb57c69fc44
2025-04-15 07:32:53 +00:00
Sergei Tachenov 90f7d61b62 [terminal] IJPL-182482 Fix the terminal tests to account for FUS activities
There are two ways to fix this: either to imitate the real
scenario or by relaxing the state checks in the FUS activities
themselves. Otherwise tests fail because the FUS activity
is invoked in the wrong state (e.g., characters make their
way into the text buffer without being read first).

Let's fix it on the test side to avoid making changes
to production that are only needed for tests.

GitOrigin-RevId: 922f947f3c745de620112ec85b6e6932116c8a2b
2025-04-15 07:32:53 +00:00
Sergei Tachenov 560735e5a6 [terminal] IJPL-182482 Implement terminal frontend output latency FUS
The hardest part here is to understand when the received data
is actually displayed. The problem is that it may not be displayed
at all, for example, if the editor is hidden or scrolled away.

Using the hooks added to the editor, we can make an assumption:
if the editor is showing, and there was a repaint request,
then it's very likely to be repainted soon. In that case we wait
for the repaint before reporting the latency.

If there's no repaint request, then we report the latency immediately,
adding a boolean flag to the event to distinguish between the cases.

Because events are received and applied as whole,
there are no separate events for the first and last characters.
Instead, we report both character indices in one event.
So for two backend events we have one frontend event.

GitOrigin-RevId: df72687dc3ef31bece6eeaf7cd624dc18c462d6e
2025-04-15 07:32:53 +00:00
Sergei Tachenov 2d39d61306 [terminal] IJPL-182482 Add repaint / paint callbacks to EditorImpl
These are low-level hacky hooks that are needed to track
repaint requests and the following paint operations
to measure terminal frontend output latency.
With these hooks we can try to measure when the output
is actually painted.

GitOrigin-RevId: d308e50ebffd0705251c3d560e2979d9ff8a7f48
2025-04-15 07:32:53 +00:00
Sergei Tachenov add7b1857f [terminal] IJPL-182482 Implement terminal backend output latency FUS
This is much harder than the input latency.

The output has a lifecycle of several phases.

The first phase: chars are read from the TTY connector.
This happens on the terminal emulator thread,
and we get a whole array of chars with a single timestamp.

The second phase: chars are processed by the emulator
at its own pace. This also happens on the terminal emulator
thread, so at least we can track this processing in a synchronous
manner. Some characters arrive into the text buffer,
but not all of them, as some control characters don't affect
the buffer. So we need to be careful to figure out
the char indices that actually made their way into the buffer.
The text buffer is updated under the text buffer lock,
but not all processing happens under this lock.

The third phase: the text buffer is collected (scrapped).
This doesn't happen on the terminal emulator thread,
but it happens under the same text buffer lock.
At this point an event is created, and we must carefully
match it to character indices.

The fourth phase: the event is collected by the frontend.
Finally we can measure the latency. But the latencies of the first
and the last characters can be different if they were read
at different times. So we report two latencies.

A dangerous part is that we need to ensure that events
are always collected. The current implementation guarantees
it. If during startup or shutdown an event or two are not collected,
it's not much of an issue as there's no global state here,
unlike the input latency measuring. The entire activity
is disposed along with the session.

Because, unlike input, it's possible to have parallel outputs,
every event is reported with the session ID.

GitOrigin-RevId: 50c2626163e03d905a4b62762276fda59b450452
2025-04-15 07:32:53 +00:00
Sergei Tachenov a1b6b8d5a9 [terminal] IJPL-182482 Generalize IdentityWrapper
It'll be reused for other similar maps.

GitOrigin-RevId: 564f97a37391f91e2a78842da5b502395b8812a4
2025-04-15 07:32:53 +00:00
Sergei Tachenov a9c2be092f [terminal] IJPL-182482 Extract LocalTerminalTtyConnector
This is a simple refactoring, needed to add more hooks
to the connector to implement output latency measuring.

GitOrigin-RevId: 6d3cfb6a679d7e72abdc5bd5e47b2cd5569c0ac7
2025-04-15 07:32:52 +00:00
Sergei Tachenov c082a207f0 [terminal] IJPL-182482 Implement terminal backend typing latency
This process is not single-threaded, but it involves only
one thread transfer: from the receiving coroutine
to the terminal thread, which uses an executor
that is never shut down, so it's pretty much a guarantee
that for every byte array there will be at least an attempt
to write it. Using this fact, we can store a byte array to activity
map and remove activities when the byte arrays are written.
Using a try-finally block there ensures that the activity is eventually
finished.

The activity ID is transferred along with the event,
to ensure that the same ID is used on the frontend and on the backend.

GitOrigin-RevId: 66587a5cca59053dab1e4bf2bee9bd098fe10637
2025-04-15 07:32:52 +00:00
Sergei Tachenov 2681b905e6 [terminal] IJPL-182482 Implement terminal frontend typing latency FUS
The latency is measured from the Swing input event
to the moment when the resulting event is written to
the session's input channel, as that's where the frontend
part ends.

Measuring consists of two phases: Swing input event processing,
which is easy because it's single-threaded and is put in a try-finally
block; and terminal input event processing, which is trickier
because of the coroutines and the channel. Thankfully,
the channel provides API to ensure that a "resource" is always
closed: either the send operation fails, or the element is received,
or an "undelivered element" callback is fired. In order for it to work,
the channel also must be canceled (not just closed) eventually.
This allows us to keep an event-to-FUS-activity map and ensure
that it's always cleaned.

Input events are assigned global sequential IDs without corresponding
session IDs or anything like that because at the time the Swing event
arrives, it's not known yet which terminal session it belongs to,
or even if it belongs to any at all. So we just measure the time it takes
for an event to arrive to any session, if at all. It shouldn't be
an issue because it's impossible to have parallel input activities.

The latency is reported in microseconds, because it's very often
less than one millisecond.

GitOrigin-RevId: a31bdfe60d9e32fb16d0391d855a5e26011bf8fb
2025-04-15 07:32:52 +00:00
Konstantin Hudyakov ea0c267815 [terminal] IJ-CR-160250 Clarify the requirements for the RPC method that returns the channel
GitOrigin-RevId: 5f6c8a84da8062db07067e307c63a8a94cee8559
2025-04-15 07:32:52 +00:00
Konstantin Hudyakov a5942a9eaf [terminal] IJ-CR-160250 Refactor: mention backend in terminal input file name
We have the class with the same name on the frontend. Let's mark this one as backend to make it easier to distinguish the files.

GitOrigin-RevId: 071b4375b72311c9ce5f6c64ed347e1eb3841c0b
2025-04-15 07:32:52 +00:00
Vera Petrenkova 706f645207 [markdown] IJPL-177111 Create separate intellij.markdown.xml for shared part between frontend/backend functionality
GitOrigin-RevId: 8ca7f1921a7747e38e0aeca74529c3850e1df901
2025-04-15 07:21:53 +00:00
Vera Petrenkova cf8fa56ff5 [markdown] IJPL-177111 adjust module structure
GitOrigin-RevId: 837b80ed529c4a7166937efbba899b9aeb63da02
2025-04-15 07:21:53 +00:00
Vera Petrenkova bd2464440e [markdown] IJPL-177111 adjust module structure and rpc registration
GitOrigin-RevId: dfb37dd114291efabb3961b3e6535089c821f077
2025-04-15 07:21:53 +00:00
Milan Doslic cd2fdf257f [markdown] IJPL-177111 remove artificial plugin aliases
GitOrigin-RevId: 9a017f8dfaaaf4fc4f4bb338874f6e4c50aca8ca
2025-04-15 07:21:53 +00:00
Milan Doslic 447cea89c5 [markdown] IJPL-177111 refactor Markdown components for consistency and clarity
GitOrigin-RevId: 531f7c07d9a8be35cf6db5bd56a7aaa66a07488c
2025-04-15 07:21:53 +00:00
Milan Doslic be919d5f08 [markdown] IJPL-177111 remove MarkdownFrontendService
The deprecated MarkdownFrontendService has been removed, along with the associated application service. Functionality previously handled by the service is now migrated to MarkdownLinkOpenerUtil.

GitOrigin-RevId: 80f8c549a4dd1614aff883b1010f197ce56b11bb
2025-04-15 07:21:53 +00:00
Milan Doslic 8cd04eb35c [markdown] IJPL-177111 combine multiple RPCs needed for link opening into one
Refactored Markdown link navigation by introducing MarkdownLinkNavigationData. Legacy URI-based handling has been replaced to streamline file and header navigation while eliminating redundant methods. Instead of performing slow findVirtualFile calls on EDT, the implementation now passes a VirtualFile directly to the openFile and navigateToHeader actions. Related services, DTOs, and mappings were updated accordingly to support the new, more efficient approach.

GitOrigin-RevId: 4545b23b17c55fe191e1b3c1f77617b6c409818d
2025-04-15 07:21:53 +00:00
Milan Doslic 4ba841da7b [markdown] IJPL-177111 fix IJPL-167949 by adding ProcessImagesExtension
Introduced `ProcessImagesExtension` to handle image resources in the Markdown browser preview. Added a new remote API (`ProjectStructureRemoteApi`) to retrieve project-specific resources.

GitOrigin-RevId: 9a3e8f02e167c23e4954e9ebdaa58a9bfd2330fd
2025-04-15 07:21:53 +00:00
Milan Doslic c896bc7e89 [markdown] IJPL-177111 add a Registry flag for Markdown link opening fallback
Introduced a registry flag (`markdown.open.link.fallback`) for controlling the fallback to the previous implementation of Markdown link handling. Also includes refactoring and code adjustments for improved clarity.

GitOrigin-RevId: 2cab3173b9d85f751a17c96e8f8444be6519b22f
2025-04-15 07:21:53 +00:00
Milan Doslic 9ce83874aa [markdown] IJPL-177111 fix the link opening from the Markdown preview in Remote Development
Previously, all links in split mode were opened in the browser because ClientHandler had no way of understanding file path links. To fix it, resolveLinkAsFilePath method was added to the backend.

GitOrigin-RevId: 789db4e0770a85546180b259b8a2de447a705f91
2025-04-15 07:21:52 +00:00
Milan Doslic d5dd6ad7de Revert "[markdown] IJPL-177111 add a Registry flag for falling back to the old implementation of link opening"
This reverts commit e17374dd72c71d821ba15b2756a13d001d46150c.

GitOrigin-RevId: 748622f699497dc41c35e9676d57928f87f38dc5
2025-04-15 07:21:52 +00:00