vscode-plantuml icon indicating copy to clipboard operation
vscode-plantuml copied to clipboard

When using newpage in a procedure output is truncated

Open nfehrenbach opened this issue 3 years ago • 2 comments

Attempting to split sequence diagram into multiple pages will not work if the newpage keyword is inside a procedure block.

example

@startuml


actor Actor as a
participant Business as b
participant Customer as c

!$var1 = true
!$var2 = "Abc"

!procedure $test($nm)
    ' newpage
    == $nm ==
!endprocedure

!procedure $msg($str)
    c -> b: $str
    b -> a: $str
    a --> c
!endprocedure

a -> a: self start

$test("1")
$msg("First msg")
a -> a++: $var2
!$var2 = "def"
a --> a: $var2
$test("2")
$msg("msg")
deactivate a
$msg("Test Message " + $var2)
$test("3")
$msg("What is happening?")

@enduml

version: 1.2021.7

nfehrenbach avatar Oct 29 '21 21:10 nfehrenbach

confirmed, but there's no easy solutions.

the extension detects page count naively by count how much newpage keyword in the code. when it come to the macro cases, it won't work.

just like syntax highlight problems, the final solution would be implementing a language parser which I'm not capable to do so.

qjebbs avatar Nov 19 '21 06:11 qjebbs

What about this one? https://github.com/Enteee/plantuml-parser

hawk78 avatar Oct 04 '22 07:10 hawk78