vscode-plantuml
vscode-plantuml copied to clipboard
The 'break' keyword causes problems when formatting
First of all, thanks for the very useful extension.
Here is the problem. When using the 'break' keyword in a loop, the indentation is broken after formatting.
Before formatting:
@startuml
start
repeat
if (Abort?) then (yes)
:Cleanup;
break
endif
:Do Something;
repeat while (Completed?) is (no)
stop
@enduml
After formatting:
@startuml
start
repeat
if (Abort?) then (yes)
:Cleanup;
break
endif
:Do Something;
repeat while (Completed?) is (no)
stop
@enduml
Best regards.
I have checked the source code 'FormatRules.ts' a bit.
This problem is caused that the "break" keyword in PlantUML is a block keyword in sequence diagrams, but not in activity diagrams.
However, it does not seem easy to solve this problem in the keyword-based formatter, because the same keywords need to be considered as different contexts.