Files
openide/plugins/stream-debugger
Alexey.Merkulov 4c5fca5bc6 [debugger] Refactoring: move utility method to common debugger module
(cherry picked from commit 6f6e50e992fe534f44636136d36c1e53067329b4)


IJ-CR-151042

GitOrigin-RevId: 80c7d32c3b8b297a01e46ed4170a4abe0f2adf0f
2024-12-09 18:30:49 +00:00
..

stream-debugger-plugin

In some ways, Stream API is better than traditional loop approach: it takes full advantage of modern multi-core architectures, and lets you process data in a declarative way. What's also good is that this approach helps to avoid the state issues, and the code written in it looks more elegant. But, there's a certain downside to it: the code sometimes is sure hard to read, understand, and, of course, to debug.

This plugin is here to amend that and offer solutions to the issues you might run into. It extends the Debugger tool window by adding the Trace Current Stream Chain button, which becomes active when debugger stops inside of a chain of Stream API calls.

After you click it, the current data stream is evaluated and you get a visualization of what exactly happens to each element from the first call to last, with changes occurring gradually as it's passing thru all the steps:

The Split Mode button in the left bottom corner lets you choose whether you want to see all operations at once or separately:

In the latter mode, you can switch between operations manually using the tabs on top.

Watch the following short animation to see these features in action: