Vanco / SequencePlugin

SequencePlugin for IntelliJ IDEA
Other
693 stars 198 forks source link

Add Support to Streams #164

Closed jrzabott closed 1 year ago

jrzabott commented 1 year ago

Is your feature request related to a problem? Please describe. When using it in a large project, when I have functional style programming, I cannot see method invocation, when mapping, peek or whatever, as part of Diagram

Describe the solution you'd like Include those calls as well.

Describe alternatives you've considered change programming style!?

Additional context I cannot. I am sorry. Maybe an altered snippet. All steps in the line 03, do not appear in Sequence Diagram. Edit: I forgot to add that I can see only step on line 07, immediately after step on line 01.

01  private void myMethod1() {
02      final ResultObject resultObject = new ResultObject();
03      this.validationFactory.getValidators().stream()
04          .map(ClassA::getData)
05          .map(ClassB::getListOfData)
06          .flatMap(List::stream)
07          .forEach(dataItem::addDataItem);
08
09      if (resultObject.isEmpty())
10          return;
11
12      items.add(ipfProfileData);
13      GroupedResults groupedResults = saveTo(items.addToCategory(MyEnum.CATEGORY));
14      write(groupedResults);
15  }

Current config:

image

P.S.: of course, there are missing points in this snippet, but I think we can get the main idea, from it. Right?

Edit: this is what it looks like (all the transformation chain is missing):

image
Vanco commented 1 year ago

You can try to opt-out Display only project classes setting. the stream, map, forEach ... may not in your project classes, its 3rd code mostly. so the opt-out Display only project classes will draw more in diagram.

jrzabott commented 1 year ago

Yeah, they are not. The the method they invoke, are. So I think they should I appear. In the end of the day, map is calling a method in my project, right?

Thanks for the quick response, wi try you suggestion and revert soon.

Daniel Junior

jrzabott commented 1 year ago

Well, I still don't think this is the desired result... Now, I can see the map, flatMap and other funcions I have invoked, but not the method and eventually subsequence calls/transformation it suffers.

Screenshot 2023-08-04 at 09 36 40
Vanco commented 1 year ago

the callable reference is equally to lambda expresion: .map(ClassA.getData) same as .map(s -> ClassA.getData(s))

the sequence diagram is like:

callable reference lambda expression

StreamTest.java.zip

Vanco commented 1 year ago

fixed version 3.0.6.

jrzabott commented 1 year ago

sounds great! will test it later. Thanks e great job, btw. :) 👍