Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The 'break' keyword causes problems when formatting #477

Open
exceedsystem opened this issue Feb 18, 2022 · 1 comment
Open

The 'break' keyword causes problems when formatting #477

exceedsystem opened this issue Feb 18, 2022 · 1 comment

Comments

@exceedsystem
Copy link

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.

@exceedsystem
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant