ballerina-dev-tools icon indicating copy to clipboard operation
ballerina-dev-tools copied to clipboard

Implement an LS extension for the revamped sequence diagram

Open nipunayf opened this issue 10 months ago • 0 comments

Description:

$title. To grasp the idea of the revamped sequence diagram, consider the following source code and its produced diagram. In contrast to what we have now, the proposed sequence diagram only highlights the interactions and the nodes related to such interactions. The proposed LS extension produces the JSON model required to visualize the diagram.

function fn1(int maxCount) { 
  int count = 0;
  while count < maxCount {
    count = fn2(count);
  }
  fn3(count.toString());
}

function fn2(int i) => i + 1;

function fn3(string s) => print(s);
sequenceDiagram
    loop count < maxCount
        FN1->>FN2: int i
        FN2-->>FN1: int 
    end
    FN1->>FN3: string s
    FN3-->>FN1: 

nipunayf avatar Mar 29 '24 09:03 nipunayf