Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Make multi-line cimment delimiters (/' and '/) work on a single line

0 votes

I'd like to see /' and '/  operate on a single line, much as the C preprocessor allows /* and */ to work on a single line. This would allow marking & commenting individual lines. For instance,


/' 1 '/      ABC -> DEF   :  This is message 1

             GHI -> JKL   :  This is message 2

/' 2 '/      MNO => PQR   :  This is message 3


Adding inline comments could also be useed to temporarily override s dnipper of code for debgging.

autonumber /' 10 '/ 11

 I believe that this capability would be available to all disgram types.






asked Oct 19, 2015 in Wanted features by Spandex (190 points)

2 Answers

+1 vote
Very good idea!

This has been implemented in last beta:

It may not be working in some cases, so do not hesitate to give feedback.

Thanks for the suggestion!
answered Oct 19, 2015 by plantuml (125,190 points)
0 votes
Thanks so much for the quick turnaround.

The beta seems to treat

/' comment '/  remainder-of-line


/' comment reaminder of line '/

In other words, the comment goes to the end of the line.

Thanks again for such a terrific application!

answered Oct 19, 2015 by Spandex (190 points)
It must depend on the context, the following example seems to work for us:

Alice -> Bob : /' comment '/  remainder-of-line
/' comment '/ Alice -> Bob :  second message

Could you post a complete and non-working diagram ?

Below is an example of the non-working code. The error i get is after the 'deactivate GAMMA' statement, and it says, "Only activate command can occur before messages are sent." If I remove the /' ... '/ from the source, the code compiles and runs without error.

   !define SEQTYPE
   '*                           Sequence Definitions                           *
   title     New Feature : Inline comment blocks

   actor    "Primary Actor" as GAMMA
   database "Supporting Actor" as DELTA
   '  Activate all participants
   activate GAMMA
   activate DELTA
   alt Main Success Scenario
   /' 1 '/   GAMMA -> Delta : Send the first message
   /' 2 '/   Delta -> Gamma : Send the second message

   end  /' alt / else '/
   '  Deactivate all participants
   deactivate GAMMA
   deactivate DELTA
Thanks for the detailed report! It really helps.

This bug has been solved in the last beta : https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

For the record, the whole block was treated as a comment:
 /' 1 '/   GAMMA -> Delta : Send the first message
   /' 2 '/   Delta -> Gamma : Send the second message
   end  /' alt / else '/

Anyway, do not hesitate to report other issues.

Thanks again,
It seems to work perfectly!

Thank you so much.
Support This Project Offer 250 Mo! Follow PlantUML on Twitter