qjebbs / vscode-plantuml

Rich PlantUML support for Visual Studio Code.
MIT License
1.09k stars 155 forks source link

Diagram preview fails when newpage command is nested in a conditional that does not execute #597

Open daveokeeffe opened 3 days ago

daveokeeffe commented 3 days ago

This (great) extension does not take conditionals into account when posting the UML to a plantuml server. It appears to expect X number of pages to be returned, where X is the amount of times the newpage command appears in the UML.

It fails when posting to a local dockerised plantuml server, and to the plantuml.com server.

Minimal example:

@startuml newpage conditional test

' swap to Multiple mode to see the extension successfully render multiple pages
!$bPaging = "Single"
' !$bPaging = "Multiple"

participant Customer
!if $bPaging == "Single"
  rnote across : Single Page
!elseif $bPaging == "Multiple"
  rnote across : Page 1
  newpage
  rnote across : Page 2
!endif

@enduml

This issue was logged a few years ago where procedures were involved., but I figured I'd add this information as here.

Thanks for a great extension!